Burn delete
NewHold to delete your account, and the page catches fire from the button and burns away to a black sign-in screen.
burn-delete/burn-delete.tsxDelete your account?
Your 412 links and 38 collections go with it.
Hold for 2 seconds, or press twice, to delete your account.Sign in
Your account is gone.
The live component, numbered part by part. Every measurement is read from it as it is drawn. Point at a row to outline its part, or at a part to find its row.
The choices it offers, each value drawn live and the default marked, with how to pick one.
When to use
- The last step of deleting an account or a workspace, where the loss is total and the moment deserves weight.
- A destructive action that must not happen by accident: the 1.8 s hold is the confirmation, with no dialog in front of it.
- A launch page, a product tour or a portfolio piece, where the burn is the point.
- A flow that can be undone for a while: the screen it leaves offers Restore my account, which burns the page back.
When not to use
- Everyday deletes (a file, a message, a row). Use a plain button with an undo toast; a fire for each would wear thin by the third.
- Deletes that can’t be undone at all. The restore is half the story; without it, confirm with a dialog that names what is lost.
- Dense screens where the page under the button holds other work. The burn takes the whole stage with it.
- Pages that must stay calm. Reduced motion turns the burn into a cross-fade, but a quiet confirm dialog is lighter still.
Holding to confirm
- 1.8 s, linear, long enough that no click deletes by mistake, short enough not to feel like a chore.
- Let go early and it drains three times faster than it filled, so a second try starts where the first left off only for a moment.
- Space and Enter hold the same way as a pointer. A key tap, like a short press, says “Delete cancelled”.
- One press with no hold, as a screen reader or a switch sends, arms the pill instead: a second press within 5 s deletes.
The burn
- It starts at the pill and spreads unevenly, slow at first and faster as it goes, until it is past the stage’s corners in 5.2 s.
- The rim is white-hot, through pink and salmon to an indigo glow on the black; the fire runs deep along the bottom edge, in tongues that climb.
- Flakes fly off the front, mostly from its upper half: charred scraps, some with a lit edge, a fifth of them glowing gold.
- The restore runs it backwards in 2.4 s onto the pill, the page scorched brown around the shrinking hole, and leaves smoke that clears in 4 s; the pill comes back hot and cools.
Each one drawn with the component itself, used well or badly.
The words are the page’s question, what goes with the account, the pill, and the sign-in screen after.
- A question that names the thing:
Delete your account?, notAre you sure?. - What is lost, in numbers, on one line:
Your 412 links and 38 collections go with it. - The pill says the gesture and the act:
Hold to delete. Armed by a single press it saysPress again to delete. - After, plain facts:
Your account is gone., and a way back that says what it does:Restore my account.
You can add this component with the shadcn CLI or by hand:
Into components/burn-delete of any React project, with no setup:
npx shadcn@latest add https://brunodelorence.com/r/burn-delete.json- Copy the component files
Copy these files into one folder of your project, keeping their relative imports together, or download them as a ZIP:
- Import it
As shown under Usage, below.
Either way it needs React 19.2 and a bundler that supports CSS Modules, such as Next.js or Vite. It has a dark colour scheme: it follows your page’s color-scheme, light unless the page sets one, or its colorScheme prop, with nothing to configure. Browsers without light-dark() show it light.
Usage
import { BurnDelete } from './burn-delete';export function DeleteAccount() { return ( <BurnDelete name="Ines Navarro" onDelete={() => scheduleDeletion()} onRestore={() => cancelDeletion()} autoplay={false} /> );}Each state below is a live instance, locked so you can study it.
The pieces it is built from, each with its measurements read live.
A white page asks “Delete your account?” over a dark pill, Hold to delete. Held down, the pill fills with heat from the left; let go early and it drains back. Held to the end, the page catches fire from the pill: a hole with a white-hot rim spreads out, flames climbing from its lower edge and charred flakes flying off its top, until the page is gone and a black screen with drifting embers says your account is gone. Restore my account burns it the other way, back onto the pill.
- The hold is 1.8 s and linear; released early, the heat drains three times faster. The heat is one gradient, dark red to white-hot, sized to the share held and clipped at its edge, with the pill’s words in dark ink on it.
- The burn is one fragment shader over the stage: each pixel’s distance from the pill against a radius roughened by two layers of value noise, big slow lobes and a fine flickering jag. That signed distance, in hundredths of the stage, picks every colour.
- Inside the edge, a band of fire from white-hot through pink and salmon to an indigo glow: 3 units deep along the top, up to 28 along the bottom, where it climbs in tongues of noise stretched tall and scrolling up. Past it, black, with sparks drifting up in grid cells.
- Outside the edge, a thin charred line, a pink-white heat haze and soft flames licking up the page above the hole; on the way back, a deeper brown scorch, and smoke that clears in 4.2 s.
- The radius grows from the pill to past the stage’s corners in 5.2 s on t^1.6, slow at first and faster as it goes; a restore shrinks it back onto the pill in 2.4 s, eased in and out, and the pill comes back hot and cools.
- Flakes fly off the front on a 2D canvas, up to 520 at once, mostly from its upper half: six-sided charred scraps, a third of them with a lit edge, a fifth glowing gold, each living one to three seconds, rising, fluttering and spinning.
- The sign-in screen’s words show through the hole as it grows: a radial mask follows the radius. One requestAnimationFrame loop runs it all, only while something moves and the stage is on screen; the WebGL context is asked for only when a burn first needs it.
- While on screen and untouched, a demo pointer holds the pill, waits out the burn and restores the account, in a loop; any input from the reader stops it.
| Prop | Type | Default | Description |
|---|---|---|---|
defaultPhase | 'idle' | 'gone' | 'idle' | Where it starts: on the page with the hold pill, or on the black screen the burn leaves. |
onDelete | () => void | — | Called once the hold completes and the burn starts. |
onRestore | () => void | — | Called when Restore my account is pressed. |
name | string | 'Ines Navarro' | The byline over the question: whose account it is. |
still | { hold: number } | { burn: number } | { armed: true } | — | A still for docs and screenshots: the pill held part way, the burn stopped part way (0 to 1), or the pill armed by a single press. It turns the autoplay demo off. |
autoplay | boolean | true | While on screen and untouched, a demo pointer deletes and restores, in a loop; any input from the reader stops it. |
colorScheme | 'light' | 'dark' | 'system' | — | Light or dark colours for the page, or the reader’s; without it, the page’s color-scheme. The black screen is the same on both. |
className | string | — | A class for the stage. |
Keyboard
- Tab reaches the pill. Holding Space or Enter fills it like a held pointer; releasing early drains it.
- Once the hold completes, the focus moves to the Sign in heading of the new screen; Tab goes on to the field, Continue and Restore my account.
- After a restore the focus goes back to the pill. The screen not shown is inert: out of the tab order and the accessibility tree.
Screen readers and switches
- The pill is a button named Hold to delete, described as “Hold for 2 seconds, or press twice, to delete your account”.
- A press with no hold arms it (“Press again to delete your account.”); a second press within 5 s deletes, so nobody has to hold anything.
- A polite live region says what happened: “Delete cancelled”, “Account deleted”, “Account restored”. The canvases are hidden from screen readers.
Motion
With reduced motion the burn, the flakes and the smoke are left out: the two screens cross-fade in 0.4 s. The heat still fills the pill, since it shows how long is left to hold, and the demo does not play. Without WebGL it falls back to the same cross-fade.
Colour and contrast
The question is over 15 : 1 on the page in both schemes, and the pill’s words over 15 : 1 on the pill. On the heat the words turn dark with a pale halo under them, so they read over its darkest red as well as its white-hot edge. On the black screen, the heading and Continue are over 15 : 1, and the grey lines and the field’s hint over 4.5 : 1.
In this build
- The pill is a button named Hold to delete and described as “Hold for 2 seconds, or press twice, to delete your account”. Holding Space or Enter fills it like a held pointer.
- A press with no hold, as a screen reader or a switch sends, arms the pill (“Press again to delete”); a second press within 5 s deletes, so nobody has to hold.
- A polite live region says “Delete cancelled”, “Account deleted” and “Account restored”. After a delete the focus moves to the Sign in heading; after a restore, back to the pill.
- The screen not shown is inert. The email field has a label; both canvases and the demo pointer are hidden from screen readers. Every control shows a focus ring on keyboard focus.
- With reduced motion, or without WebGL, the burn, flakes and smoke are left out and the two screens cross-fade in 0.4 s; the heat still fills the pill, and the demo does not play.
The complete source behind this demo. Open source under the MIT license, © 2026 Bruno Delorence: copy it, change it, ship it.
// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import { useEffect, useEffectEvent, useId, useRef, useState, type FormEvent, type KeyboardEvent as ReactKeyboardEvent, type PointerEvent as ReactPointerEvent,} from 'react';import { createBurn, fullRadius, unitOf, type BurnRenderer } from './burn-gl';import { createFlakes, type Flakes } from './flakes';import { DemoPointer, runDemo, type Point } from './demo-pointer';import { useAutoplay } from './use-autoplay';import styles from './burn-delete.module.css';/* * Burn delete: a page asks “Delete your account?” over a dark pill, Hold to delete. Held down, * the pill fills from the left with heat; let go early and the heat drains back. Held to the * end, the page catches fire from the pill: a hole with a white-hot rim, flames and flying/* Burn delete (burn-delete.tsx): a page that asks to delete your account, its dark pill held down to confirm; then the page burns away from the pill and leaves a black sign-in screen. Layers, bottom to top: the page; the burn canvas (the hole, its rim and flames, the dark screen's embers); the dark screen's words and fields, masked to the hole while it grows; the flakes canvas; the demo pointer. Sizes. Every length is a number of design units times --k, the px of one unit: the reference layout is 1198 units square, the pill 258 × 66, the heading 50. --k follows the stage's width (a container query unit), from 0.5 to 0.82 px. Colours are the tokens below, light-dark(light, dark) where the two differ: the page is white by day and graphite by night, its pill inverted; the screen the burn leaves is black on both. The burn's own colours live in the shader (burn-gl.ts). */.root { /* The page. */ --page: #fbfbfb; --line: rgb(0 0 0 / 0.06); --ink: #141416; --ink-soft: #6b6b70; --pill: #161618; --pill-ink: #fff; --pill-edge: rgb(0 0 0 / 0.12);// Copyright (c) 2026 Bruno Delorence. MIT License./* * The burn, drawn by one fragment shader over the whole stage. Every pixel asks how far it is * from the burn's origin (the button), against a radius roughened by two layers of value noise: * big slow lobes, so the hole grows unevenly, and a fine jag that flickers, so its edge looks * torn. That signed distance f, in units of a hundredth of the stage, decides everything: * * - f < 0, burnt: first a band of fire, white-hot at the edge through pink and salmon to an * indigo glow, 2 units deep along the top and up to 26 along the bottom, where it rises in * tongues (noise stretched tall, scrolling up); past it, black. * - f > 0, the page still standing: a thin charred line on the edge, a scorched brown band * (deeper as the page is restored), a white and pink heat haze, and soft flames licking up * the page above the hole. * - Far inside, the dark screen's fine embers: a grid of cells, one spark in some of them, * drifting up and twinkling. * - Out of the burn, the grey smoke the page is left with after a restore, fading away. * * It writes premultiplied alpha, so the page under the canvas shows wherever nothing is drawn. */const VERTEX = `attribute vec2 a;void main() { gl_Position = vec4(a, 0.0, 1.0); }// Copyright (c) 2026 Bruno Delorence. MIT License./* * The bits of page that fly off the burn front: charred flakes and glowing embers, drawn on a 2D * canvas over everything. They are thrown from the front, mostly from its upper half (the heat * rises), outwards and up, flutter as they climb, spin, and fade over one to three seconds. * A fifth glow gold; the rest are dark scraps, a third of them with a lit edge. */type Flake = { x: number; y: number; vx: number; vy: number; spin: number; angle: number; size: number; life: number; age: number; kind: 'char' | 'edge' | 'glow'; /** A rough six-sided scrap: each corner's distance, as a share of size. */ shape: number[]; phase: number;};// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import type { CSSProperties, Ref } from 'react';/* * The demo's pointer, and the steps that move it. A demo is a script of awaited steps: wait, or * glide the pointer somewhere. Stopping the demo (the reader takes over, or it scrolls away) ends * the step in progress at once: its promise rejects, which ends the script right there, and the * pointer fades out. * * Each glide is a curved flight played by the Web Animations API, so nothing runs frame by frame. * The points of the flight are handed to whoever wants to move along with it (nothing here uses * them yet). The arrow and the hand are HTML boxes * that swap by their visibility: a change of style inside an SVG would lay the SVG out again. */export type Point = { x: number; y: number };/** A glide's path and timing, for an animation that plays along with it. */export type Flight = { points: Point[]; timing: KeyframeAnimationOptions };export type Demo = {// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import { useCallback, useEffect, useRef, useState } from 'react';/* * When a demo may play on its own: while part of it is on screen and the tab is visible, never * under reduced motion, and never again once the reader has used it: `take()` hands it to the * reader for good (until the component mounts again), so it can't come back on its own. */export function useAutoplay<T extends HTMLElement>() { const ref = useRef<T>(null); const [visible, setVisible] = useState(false); const [reduced, setReduced] = useState(true); const [taken, setTaken] = useState(false); useEffect(() => { const element = ref.current; if (!element) return; let onScreen = false; const update = () => setVisible(onScreen && !document.hidden); const observer = new IntersectionObserver( ([entry]) => {