Easeout LabSend Button
Send Button
The plane carries your words: the label's letters board an origami plane, which banks away on a fading contrail while a ring fills round its slot, then drops home once it's Delivered.
ToDDarshit
Our homepage gets traffic but no demos. Could you take a look this week?
Replies in 24h
Install
npx shadcn add@easeout/send-buttonDependencies
motiontailwindcss
Tags
ButtonsFree componentMIT
Usage
After installing, it lives at components/send-button.tsx
import { SendButton } from "@/components/send-button"
export default function Example() {
return (
<SendButton
labels={{ idle: "Send message", sending: "Sending", sent: "Sent" }}
onSend={() => fetch("/api/contact", { method: "POST" })}
/>
)
}
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
onSend | () => unknown | Promise<unknown> | – | Runs on click. The button stays on Sending until it settles; a rejected promise shows the failed label. |
labels | { idle?, sending?, sent?, failed? } | Send · Sending · Delivered · Try again | The four labels. The idle label is what boards the plane; the button eases to each new width. |
minFlight | number | 1500 | Shortest time on Sending in ms, so the flight always finishes. |
resetAfter | number | 2200 | How long Delivered stays before the plane comes home. 0 keeps it. |
className | string | – | Classes for the button. It uses bg-foreground and text-background by default. |