Skip to content

Instantly share code, notes, and snippets.

@frsechet
Last active June 30, 2022 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frsechet/f2c59db56c149dade53c77598229d188 to your computer and use it in GitHub Desktop.
Save frsechet/f2c59db56c149dade53c77598229d188 to your computer and use it in GitHub Desktop.
Slack coverage of CSML components
start:
say "His palms are sweaty, knees weak, arms are heavy"
say Text("There's vomit on his sweater already, mom's spaghetti")
say "He's _nervous_, but **on the surface** he looks ~calm and ready~"
say Typing(2000)
say Question(
"Hi! My name is:",
buttons=[
Button("What?", payload="btn1"),
Button("Who?", payload="btn2", style="danger"),
Button("Slim Shady", payload="btn3", style="primary"),
]
)
hold
say "User selected: {{event}}"
say Image("http://placekitten.com/500/500")
say Video("https://cdn.csml.dev/customers/93bfb0df-fb6b-4ed2-87b0-8d93a09b0ad8/files/cbaa0959-fe58-4a2a-89c3-c414a1f38748/big_buck_bunny.mp4")
say Audio("https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3")
say Url("https://www.wikipedia.org/")
do card1 = Card(
"The Marshall Mathers LP",
subtitle="Release date: May 23, 2000",
image_url="https://upload.wikimedia.org/wikipedia/en/a/ae/The_Marshall_Mathers_LP.jpg",
buttons=[
Button("Listen to this album", payload="marshallmatherslp1"),
Url("https://www.eminem.com/", text="Visit eminem.com"),
]
)
do card2 = Card(
"The Slim Shady LP",
subtitle="Release date: February 23, 1999",
image_url="https://upload.wikimedia.org/wikipedia/en/3/35/Eminem_-_The_Slim_Shady_LP_CD_cover.jpg",
buttons=[
Button("Listen to this album", payload="theslimshadylp"),
Url("https://www.eminem.com/", text="Visit eminem.com"),
]
)
do card3 = Card(
"The Marshall Mathers LP 2",
subtitle="Release date: November 5, 2013",
image_url="https://upload.wikimedia.org/wikipedia/en/8/87/The_Marshall_Mathers_LP_2.png",
buttons=[
Button("Listen to this album", payload="marshallmatherslp2"),
Url("https://www.eminem.com/", text="Visit eminem.com"),
]
)
say Carousel(cards=[card1, card2, card3])
hold
say Calendar(title="Select your date of birth")
hold
say Checkbox(
// Mandatory
options = [
Button("Cats 🐕", payload="meow"),
Button("Dogs 🐶", payload="woof"),
Button("Hot dogs 🌭", payload="yummy"),
],
// Optional fields:
title="What's your favorite animal?",
description="You can pick many!",
)
hold
say Radio(
// Mandatory
options = [
Button("Cats 🐕", payload="meow"),
Button("Dogs 🐶", payload="woof"),
Button("Hot dogs 🌭", payload="yummy"),
],
// Optional fields:
title="What's your favorite animal?",
description="You can pick only one!",
)
hold
say Input(
title="Enter something below",
description="This is a simple text field, and you can say whatever you want",
placeholder="Whatever you want",
submit_label="Submit",
)
hold
goto end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment