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-button

Dependencies

motiontailwindcss

Tags

ButtonsFree componentMIT

Usage

After installing, it lives at components/send-button.tsx

app/example.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

PropTypeDefaultWhat 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 againThe four labels. The idle label is what boards the plane; the button eases to each new width.
minFlightnumber1500Shortest time on Sending in ms, so the flight always finishes.
resetAfternumber2200How long Delivered stays before the plane comes home. 0 keeps it.
classNamestring–Classes for the button. It uses bg-foreground and text-background by default.

Want a whole page built like this?