AshBurstButton

A ringed dark button that glows like an ember on click and erupts ash that collides with it via Matter.js physics, piling onto its surface.

Preview

Props

Install

npx shadcn@latest add @evilbuttons/ash-burst-button

Usage

import { AshBurstButton } from "@/components/evil-buttons/ash-burst-button";

export function ButtonDemo() {
  return (
    <AshBurstButton
      colors={["#171717", "#404040", "#737373", "#f97316"]}
      particleCount={120}
      onDestroy={() => console.log("Burned.")}
    >
      Incinerate
    </AshBurstButton>
  );
}

Props

The component spreads native button props. onClick still fires before the burst; call event.preventDefault() to skip it.

PropTypeDefaultDescription
childrenReact.ReactNode-Button label. Falls back to label.
labelReact.ReactNode"Delete"Label used when no children are provided.
particleCountnumber80Physics particles per burst.
spreadnumber110Explosion spread in degrees.
startVelocitynumber42Launch velocity (mapped into Matter).
colorsstring[]charcoal/ember paletteCustom particle colors. Warm reds and oranges get a soft glow.
iconbooleantrueShow the leading flame icon.
onDestroy() => void-Fired after each ash burst.
classNamestring-Extra classes merged onto the button.

Good to know

  • Embers are real Matter.js bodies on a full-page canvas.
  • Physics is skipped under prefers-reduced-motion.

Search docs

Jump to a button documentation page