Code And Chill

Dart — Animated Send Button (Paper Plane)

Buttons 3

About

A Send button that folds itself into a paper plane, throws it off the corner and lands on Sent. Accessible, reduced-motion aware. Plain HTML/CSS/JS drop-in in the full version: codeandchill.store/components/dart?utm_source=21st

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Dart — Animated Send Button (Paper Plane) to your project and fits it to your theme.

Code

How Dart — Animated Send Button (Paper Plane) is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { useEffect, useState } from "react";
import DartSendButton from "@/components/ui/dart-send-button";

const settings = {
  label: "Send",
  sentLabel: "Sent",
  holdMs: 1500,
};

export default function Demo(props: Partial<typeof settings> = {}) {
  const s = { ...settings, ...props };
  // Dart always opens dark, then follows the page's `dark` class only when it changes.
  const [theme, setTheme] = useState<"dark" | "light">("dark");
  useEffect(() => {
    const html = document.documentElement;
    let last = html.classList.contains("dark");
    const mo = new MutationObserver(() => {
      const now = html.classList.contains("dark");
      if (now !== last) { last = now; setTheme(now ? "dark" : "light"); }
    });
    mo.observe(html, { attributes: true, attributeFilter: ["class"] });
    return () => mo.disconnect();
  }, []);

  const dark = theme === "dark";
  // One soft key light above the seat, so the page reads as a room.
  const backdrop = dark
    ? "radial-gradient(58% 42% at 50% 44%, rgba(230,192,127,.085), transparent 70%), radial-gradient(90% 70% at 50% 120%, rgba(120,140,190,.06), transparent 70%), #07080b"
    : "radial-gradient(58% 42% at 50% 44%, rgba(230,192,127,.18), transparent 70%), linear-gradient(180deg, #d9d3c6, #e8e3d8 60%)";

  return (
    <div
      className="flex min-h-[100dvh] w-full items-center justify-center overflow-x-clip px-4 pb-10 pt-40"
      style={{ background: backdrop, backgroundColor: dark ? "#07080b" : "#e8e3d8" }}
    >
      <DartSendButton
        theme={theme}
        label={s.label}
        sentLabel={s.sentLabel}
        holdMs={s.holdMs}
        onSend={() => {
          /* demo only: nothing is sent anywhere */
        }}
      />
    </div>
  );
}

More by Code And Chill

View all
  • Fernly — Project Management Dashboard with Kanban

    Fernly — Project Management Dashboard with Kanban

    764
  • Corbel — Sales Analytics Dashboard

    Corbel — Sales Analytics Dashboard

    475
  • Hovira — Glassmorphism Smart Home Dashboard

    Hovira — Glassmorphism Smart Home Dashboard

    87
  • Vitra — Glass Pricing Section

    Vitra — Glass Pricing Section

    79
  • Halden — CRM Dashboard with Sales Pipeline

    Halden — CRM Dashboard with Sales Pipeline

    69
  • Kestrel — Marketing Analytics Dashboard

    Kestrel — Marketing Analytics Dashboard

    46
  • Money River — Sankey Money Flow Chart

    Money River — Sankey Money Flow Chart

    41
  • Meniscus — Liquid Bottom Navigation Bar

    Meniscus — Liquid Bottom Navigation Bar

    33

More in Buttons

View all
  • Texture Button

    Texture Button

    122
  • Button

    Button

    172
  • HeroUI Button Group

    HeroUI Button Group

    1
  • Button

    Button

    88
  • Native Button

    Native Button

    7
  • Button

    Button

    74
  • Button Group

    Button Group

    5
  • Button

    Button

    21