Burn Button

Burn Button is a pill-shaped button that lights a spark when held (or when Space or Enter is held) and races along its outline. If the fuse burns all the way around, the button bursts with a flash, sparks, and a ring, then the fuse regrows; releasing early snaps it back.

Burn Button
LIVE · running in a sandboxed iframe
Installed with plain shadcn add · no workarounds · theme neutral (none shipped)
See how it was built

Installation

pnpm dlx shadcn@latest add @glint-ui/burn-button

Requires @glint-ui in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import { BurnButton } from "@/components/ui/burn-button";<BurnButton>Hold to ignite</BurnButton>
  • Use as a deliberate, playful call-to-action where a press-and-hold gesture adds delight, such as a launch, ignite, or charge action on a landing page or game-like UI.
  • Use when a confirmation-style hold is appropriate and a visual progress cue helps users understand that the action is still in progress.
  • Avoid for quick, frequent, or critical actions that users must be able to trigger with a single tap or click, since holding is required.
  • Pair with onComplete to trigger the real side effect only after the fuse has fully burned.

Examples

Basic hold-to-burn button

Renders the default burn button with default duration (1600 ms) and color (#fb923c).

basic-hold-to-burn-button.tsx
import { BurnButton } from "@/components/ui/burn-button";export function Example() {  return <BurnButton>Hold to ignite</BurnButton>;}

Run an action on completion

onComplete fires once each time the fuse finishes burning, so the side effect runs only after a full hold.

run-an-action-on-completion.tsx
import { useState } from "react";import { BurnButton } from "@/components/ui/burn-button";export function Example() {  const [count, setCount] = useState(0);  return (    <div className="flex items-center gap-4">      <BurnButton onComplete={() => setCount((c) => c + 1)}>Ignite</BurnButton>      <span>{count} bursts</span>    </div>  );}

Custom duration and color

A longer hold time with a cyan spark color for a different visual tone.

custom-duration-and-color.tsx
import { BurnButton } from "@/components/ui/burn-button";export function Example() {  return (    <BurnButton duration={2400} color="#22d3ee">      Charge    </BurnButton>  );}

Disabled state with custom width

Disabled buttons ignore holds; className is merged onto the root button.

disabled-state-with-custom-width.tsx
import { BurnButton } from "@/components/ui/burn-button";export function Example() {  return (    <BurnButton disabled className="w-48">      Locked    </BurnButton>  );}

API reference

PropTypeDefaultDescription
durationnumber1600Milliseconds the button must be held for the fuse to burn all the way around and trigger a burst.
colorstring"#fb923c"Color used for the spark glow, the ember dots, the burst flash, and the expanding ring.
onComplete() => void—Called once each time the fuse finishes burning and the burst fires.
classNamestring—Additional Tailwind classes appended to the root button's base classes. Inherited from ButtonHTMLAttributes.
disabledboolean—Disables the button; holds are ignored and the button is dimmed. Passed through to the native button element.
childrenReact.ReactNode—Label content, rendered inside a relatively positioned span above the effects layers.
...ButtonHTMLAttributes<HTMLButtonElement>props—All other native button attributes are spread onto the element (for example id, aria-label, name, value, form). type defaults to "button" and is set before the spread.

Accessibility

  • Holding is the only way to trigger the action; provide a non-hold alternative or ensure the hold requirement is clearly communicated, especially for users who cannot sustain a press.
  • The burn animation and burst are decorative: the SVG and effect layers are aria-hidden, so screen readers only announce the button label and state.
  • Hold progress is not announced to assistive technology; use aria-label or visible text to explain that the user must hold the button.
  • Keyboard support: Space and Enter start the burn on keydown (ignoring auto-repeat) and stop it on keyup, and both keys call preventDefault so Enter will not submit a surrounding form.
  • Focus is shown with a visible focus-visible ring (2px outline with offset) that uses the ring color.
  • Motion is reduced when prefers-reduced-motion is set: ember jitter stops and the ring effect is hidden via motion-reduce:hidden, though the fuse and flash still animate.
  • Disabled state uses the native disabled attribute, so it is removed from the tab order and announced as disabled.
  • Right-click context menu is suppressed on the button, and touch-none is applied to prevent scroll interference during holds on touch devices.

Docs written by anthropic:claude-haiku-5-5 from the registry source.

Use with Coding Agent

Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.

prompt.md
Use the "Burn Button" component (glint-ui/burn-button) from its shadcn registry.1. Install it with: npx shadcn@latest add @glint-ui/burn-button2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: duration, color, onComplete, className, disabled, children, ...ButtonHTMLAttributes<HTMLButtonElement>.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { BurnButton } from "@/components/ui/burn-button";<BurnButton>Hold to ignite</BurnButton>```

Files & dependencies

  • registry/ui/burn-button.tsx

Looks similar, elsewhere