Burn

Sets whatever it wraps on fire. The content burns away from a corner with a charred edge, a glowing rim, flickering flames and drifting sparks.

Above the clouds08.24
Props
Origin
Duration1500

Installation

pnpm dlx shadcn@latest add @breeze/burn

Usage

import { Burn } from "@/components/breeze/burn"

Wrap anything: a card, an image, a paragraph. Set burning to start the fire. The content is cut away by the flames, so whatever sits behind it shows through the holes, and it's gone once the burn ends. Set burning back to false to restore it.

<Burn burning={burning} origin="bottom-left" onBurnt={() => setDeleted(true)}>
  <Card />
</Burn>

Props

PropTypeDefaultDescription
burningbooleanStart the burn. Back to false restores the content
origin"bottom-left" | "bottom-right" | "top-left" | "top-right" | "bottom" | "center""bottom-left"Where the fire starts
durationnumber1500How long the burn takes, in ms
embersbooleantrueSparks drifting up as the front passes
onBurnt() => voidCalled once the content has burnt away
classNamestringClasses for the wrapper

The burn is an SVG filter on the content itself, so it works on any markup, text included. Heat is fractal noise plus a point of heat at origin, scaled to the element's size, so it eats in from that side with a ragged front. Behind the front there's a thin charred line, a glowing rim with a white-hot core and flames that flicker along it. Each instance burns in its own pattern. With reduced motion it fades out instead.

Once the burn ends the content is made inert and hidden from screen readers, so nothing invisible can still be clicked, focused or read out. Setting burning back to false makes it interactive again. Other props such as id, style or data-* go on the wrapper.