Slingshot Send, animated React component
A chat composer whose send button is a slingshot: pull the stone back to stretch the bands and let go, and your message flies along an arc and lands in the thread with a squash. Enter in the field, or Enter or Space on the focused stone, still sends it.
- Pro
- Inputs & Controls
- Spring
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
MayaOnline
Are we still on for tonight?
Yes! Where do you want to go?
That ramen place on 5th?
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| name | string | "Maya" | Name in the thread header; its first letter is the avatar. |
| onSend | (text: string) => void | — | Called with the trimmed text when a message is fired. Nothing is ever sent over the network by the component. |
| autoReply | boolean | true | Adds a canned reply from the other person about a second after each message lands. |
| autoplay | boolean | false | Types, pulls back and fires messages by itself until someone touches the component. |