Aurora toast
NewA dark toast at the top of a billing page, heralded by a wash of colour that falls through the page and leaves a soft glow behind it.
aurora-toast/aurora-toast.tsxBilling
November 2026
- Collected this month$48,920.00+12% on October
- Outstanding$9,415.007 invoices
- Next payout$12,460.00Thursday, Nov 6
- Failed payments2Last 30 days
Recent invoices
- #0042Harbor & Pine Co.Due Nov 4$3,240.00Open
- #0041Quill AtelierDue Nov 2$1,180.00Open
- #0040Marlow CeramicsDue Oct 30$860.00Open
- #0039Bright Lane DentalDue Oct 28$2,075.00Open
- #0038Oakridge BikesDue Oct 24$4,310.00Paid
- #0037Tidewater BooksDue Oct 21$590.00Paid
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
- Good news that arrives on its own while the person works: an invoice paid, a payout sent, a large import finished.
- A rare event worth a moment of ceremony, a few times a session at most, on a page that is otherwise quiet.
- A short message of two lines, a title and a detail with the figure that matters:
Invoice #0042 · $3,240.00. - A product tour or a landing page, where the wash shows what a notification can feel like.
When not to use
- Frequent or routine events, like each saved field or each new message. The wash every few seconds becomes noise; use a plain toast.
- Errors that block the work or need an answer. Put them inline, by the field or the action, or in a dialog.
- Anything the person must read before it goes: a toast leaves on its own. Keep it on the page.
- Busy, colourful pages. The wash needs a pale, quiet page under it to read as a sweep of light.
- More than a line of detail or any form. Toasts take one action at most: here, closing it.
Timing
- 5 seconds by default, set with
duration;0keeps the toast until it is closed. - Paused while held: the pointer over the toasts or the focus inside them stops every timer, and each picks up with what it had left.
- Escape anywhere on the stage closes the newest toast; the × closes one.
- The wash takes 1.5 s, the colour falling through in about 1.2 s; the toast is in place before it ends.
Choosing a kind
- Invoice paid for money received: the full aurora, green at the top to peach at the bottom, and a blue halo.
- Payout sent for money leaving to the bank: a cool wash, cyan to indigo.
- Payment failed for a charge that did not go through: amber to rose, a warmer slate and an amber halo. Say what failed and leave the fix on the page.
Each one drawn with the component itself, used well or badly.
Two lines: the title says what happened, the detail gives the figure.
- Title in sentence case, no full stop:
Your invoice has been paid,Payout sent to your bank,A payment failed. - Detail as fragments joined by a middle dot:
Invoice #0042 · $3,240.00,$12,460.00 · arrives Thursday. - Name the thing: the invoice number, the amount, the day. Not “Something happened”.
- For a failure, say what failed (
card declined), not whose fault it was.
You can add this component with the shadcn CLI or by hand:
Into components/aurora-toast of any React project, with no setup:
npx shadcn@latest add https://brunodelorence.com/r/aurora-toast.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 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 { AuroraToast } from './aurora-toast';export function BillingNotifications() { return ( <AuroraToast duration={6000} onToast={(notice) => console.info(notice.title)} 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 quiet billing page with its figures and recent invoices. Mark an invoice paid, send a payout or let a payment fail, and a wide crescent of colour falls through the page, green and cyan at the top, violet and magenta lower down, blurring the page as it passes. The dark toast slides in at the top centre while it falls, and the wash settles into a faint blue glow with a fine dot screen that stays behind it; a failed payment turns it all warm. Toasts stack, leave on their own, wait while you hover or focus them, and close with the cross or Escape.
- The wash is a crescent painted on a canvas a third of the stage’s size: a soft ellipse, its top cut away by a second one, with a fainter ellipse of the colour it just left trailing above. Stretched to the stage, the small canvas comes out soft without a blur filter on something that changes every frame.
- Its fall was measured frame by frame from 60 fps footage: from above the top edge, slow over the first 0.3 s, then about two stage heights a second, gone by 1.2 s; the strength rises over 0.32 s and fades from 0.92 s.
- Its colour comes from where it is: each kind has a ramp from the top of the stage to the bottom. Invoice paid runs green #8ef5bf, cyan, blue #7698fe, violet, magenta #e467d8, pink and peach; payout stays cyan to indigo; a failed payment runs amber to rose.
- Under it the page goes soft with backdrop-filter: a 3 px veil over all of it for the length of the wash, and a 12 px blur masked to an ellipse that follows the crescent through a --wash-y custom property the script writes each frame.
- The toast arrives 420 ms after the event, sliding down from above the top edge in 460 ms on cubic-bezier(0.22, 1.12, 0.36, 1); its row folds open with a grid-template-rows animation, so earlier toasts slide down 8 px under it, and folds shut as it leaves in 260 ms.
- The halo is a radial gradient of the kind’s tint with an 8 px dot screen and a 1 px backdrop blur, masked to an ellipse about twice the toast’s width; it fades in over 0.8 s and stays while any toast does.
- Sizes come from the reference at 1530 px, scaled to a 420 px toast: 72 px tall, a 17 px radius, a 40 px glyph, 15/20 and 14/19 type, a 24 px close button, 30 px from the top.
- Each toast has a 5 s timer that pauses while the pointer or the focus is on the toasts and keeps what it had left. The canvas only renders during a wash, and a wash is skipped while the stage is off screen.
- At night the canvas is added as light (mix-blend-mode: screen) at 78%; which scheme is in use is read back from a light-dark() colour on the canvas, so the prop and the page both work.
| Prop | Type | Default | Description |
|---|---|---|---|
duration | number | 5000 | How long each toast stays, in ms; 0 keeps it until it is closed. |
mode | 'stack' | 'replace' | 'stack' | Stack keeps earlier toasts below the new one; replace sends the last one away. |
max | number | 3 | The most toasts shown at once in stack mode; the oldest leaves to make room. |
wash | boolean | true | The wash of colour before each toast. Off, or with reduced motion, the toast just fades in. |
defaultToasts | ('paid' | 'payout' | 'failed')[] | — | Toasts already in place when it mounts, settled and without a wash, the first on top: a still for docs and screenshots. It turns the autoplay demo off. |
onToast | (notice: Notice) => void | — | Called with each toast as it arrives: its kind, title and detail. |
onDismiss | (notice: Notice, reason: 'timeout' | 'close' | 'escape' | 'replaced') => void | — | Called with each toast as it leaves, and why. |
autoplay | boolean | true | While on screen and untouched, a demo pointer raises a paid invoice and closes it, lets a payout leave on its own, then raises a failed payment; any input stops it. |
colorScheme | 'light' | 'dark' | 'system' | — | Light or dark colours, or the reader’s; without it, the page’s color-scheme. |
className | string | — | A class for the stage. |
Screen readers
- Each toast is said once, in a polite live region, as a sentence: “Your invoice has been paid. Invoice #0042, $3,240.00.”
- The toasts are an ordered list named Notifications, after the page in reading order; the close button is named after its toast.
- The glyphs, the halo, the wash and the demo pointer are hidden from screen readers.
Keyboard
- Tab reaches the event buttons, then each toast’s close button. Enter or Space closes it.
- Escape anywhere on the stage closes the newest toast. When a toast with the focus leaves, the focus moves to the next toast’s ×, or back to the button that raised it.
- The focus inside the toasts pauses their timers, so a keyboard reader has all the time they need.
Timing and motion
The timers pause on hover and focus (WCAG 2.2.1), and duration={0} keeps toasts until closed. With reduced motion there is no wash and no slide: the toast and its halo fade in over 240 ms. The wash is skipped while the stage is off screen.
Colour and contrast
The title is white and the detail #b4babe on the #444a4f slate, about 9 : 1 and 4.6 : 1 (WCAG 1.4.3). The kind is said in the title, never by the tint alone (1.4.1).
In this build
- Each toast is announced once in a polite live region, as a sentence (“Your invoice has been paid. Invoice #0042, $3,240.00.”); the toasts are an ordered list named Notifications.
- Each close button is named after its toast (“Dismiss: Your invoice has been paid”); Escape anywhere on the stage closes the newest toast.
- When a toast with the focus leaves, the focus moves to the next toast’s close button, or back to the button that raised it; a leaving toast is inert.
- The timers pause while the pointer or the focus is on the toasts (WCAG 2.2.1), and duration={0} keeps toasts until they are closed.
- Every button shows a focus ring on keyboard focus. The glyphs, the halo, the wash and the demo pointer are hidden from screen readers.
- With reduced motion there is no wash and no slide: the toast and its halo fade in, 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 { useCallback, useEffect, useRef, useState } from 'react';import { Dashboard } from './dashboard';import { DemoPointer, runDemo, type Point } from './demo-pointer';import { EVENTS, RAMPS, type InvoiceStatus, type Kind, type Notice } from './events';import { Cross, Glyph } from './glyphs';import { useAutoplay } from './use-autoplay';import { WASH_MS, paintWash, washAt, type Ramp } from './wash';import styles from './aurora-toast.module.css';/* * Aurora toast: a dark toast that arrives at the top of a quiet billing page, heralded by a wash * of colour that falls through the whole page and leaves a soft glow behind the toast. * * - The wash (wash.ts) is a crescent of colour painted on a small canvas that falls from above the * stage to below it in about 1.2 s, its hue changing as it goes. Under it, two layers blur the * page with backdrop-filter: a light veil over all of it for the length of the wash, and a * stronger blur masked to the crescent, moving with it. They follow the custom properties the * script writes each frame (--veil, --wash-y, --wash-glow). * - The toast slides in from above the stage's top edge 420 ms after the event, while the wash is * still high, and a halo of the kind's tint (blue, or amber for a failed payment) with a fine/* Copyright (c) 2026 Bruno Delorence. MIT License. *//* Aurora toast (aurora-toast.tsx): a pale billing page, the wash that falls through it when an event arrives, and the dark toast at the top centre with its halo. Layers, bottom to top: the page; the veil (a light blur over all of it while a wash runs); the smear (a stronger blur masked to the crescent, following --wash-y); the canvas the crescent is painted on; the toasts and their halo; the demo pointer. Sizes were measured from the reference at 1530 px wide and scaled to a 420 px toast: 72 px tall, a 17 px radius, a 40 px glyph, 15/20 and 14/19 type, a 24 px close button, 30 px from the top. Colours are the tokens below, light-dark(light, dark) where the two differ: the component takes the color-scheme it inherits from the page, or the one its colorScheme prop sets. */.root { --stage: #f5f5f5; --card: #fdfdfd; --line: #ececec; --ink: #3d4145; --muted: #6e7378; --strong: #26292c; --chip: #fff; --chip-edge: #e2e3e5;// Copyright (c) 2026 Bruno Delorence. MIT License./* * The aurora wash: a wide, soft bowl of colour that falls through the stage when a toast arrives, * changing hue as it goes, and the timeline that drives it and the blur over the page beneath. * * - The bowl is painted on a small canvas, a third of the stage's px, and the browser scales it * up: the upscale itself softens it, so no blur filter runs on a canvas that changes each frame. * - Its shape is an ellipse with a softer ellipse cut out of its top, so it reads as a crescent, * brightest along the bottom; a fainter ellipse of the colour it just left trails above it. * - Its colour comes from where it is: each kind of toast has a ramp from the top of the stage to * the bottom (the paid one green, cyan, blue, violet, magenta, pink, peach). * - Where it falls was measured frame by frame from 60 fps footage: slow over the first third of a * second while it comes in at the top, then about two stage heights a second to the bottom. */export type Ramp = [stop: number, rgb: [number, number, number]][];/** How long a wash lasts, in ms, from the event to the last of the blur. */export const WASH_MS = 1500;/** The bowl's middle, in stage heights, at each moment (in seconds) of the measured fall. */const FALL: [t: number, y: number][] = [ [0, -0.38],// Copyright (c) 2026 Bruno Delorence. MIT License.import type { Ramp } from './wash';/* * The billing workspace behind the toasts, and what can happen in it: the invoices in its list, * and the three kinds of event that raise a toast. Each kind has its words, the colour ramp its * wash falls through, and the tint of the glow it leaves behind the toast. */export type Kind = 'paid' | 'payout' | 'failed';export type InvoiceStatus = 'open' | 'paid' | 'failed';export type Invoice = { id: string; client: string; due: string; amount: string; status: InvoiceStatus;};export const INVOICES: Invoice[] = [ { id: '0042', client: 'Harbor & Pine Co.', due: 'Nov 4', amount: '$3,240.00', status: 'open' },// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import type { Ref } from 'react';import { INVOICES, KIND_LABEL, type InvoiceStatus, type Kind } from './events';import { Mark } from './glyphs';import styles from './aurora-toast.module.css';/* * The quiet billing page the toasts arrive over: a header, a title row with the buttons that * raise each kind of event, a row of four figures and the recent invoices. It is kept pale and * low in contrast on purpose, so the wash and the dark toast stand out from it; its text still * meets 4.5 : 1. An invoice's status changes when an event names it. */const STATUS_LABEL: Record<InvoiceStatus, string> = { open: 'Open', paid: 'Paid', failed: 'Failed',};const FIGURES = [ { label: 'Collected this month', value: '$48,920.00', note: '+12% on October' },// Copyright (c) 2026 Bruno Delorence. MIT License.import { useId, type ReactNode } from 'react';/* * The drawings: the toast's three glyphs (a sheet of paper for an invoice, a card with an arrow for * a payout, a sheet with a warning for a failed payment), the close cross, and the workspace's * mark. The glyphs are pale on the dark toast, each fading out toward its bottom as if it were * sliding out of a slot; they are decorative, since the title says the same in words. */export type GlyphKind = 'paid' | 'payout' | 'failed';function Sheet({ fade, children }: { fade: string; children?: ReactNode }) { return ( <> <path d="M4 4.5A2.5 2.5 0 0 1 6.5 2h22.6L36 8.9V38H4z" fill={`url(#${fade})`} /> <path d="M29.1 2v4.4A2.5 2.5 0 0 0 31.6 8.9H36z" fill="#c9ced2" /> <rect x="8.5" y="8" width="12" height="2.6" rx="1.3" fill="#9aa1a7" /> <rect x="8.5" y="13.4" width="17" height="1.8" rx="0.9" fill="#b8bec3" /> {children} </> );}// 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]) => {