Alert

@sushindustries/ui

The Markdown callout, reachable from JSX - application news in the same box the docs already use.

5 min read
View as MarkdownEdit on GitHub

Alert is the Markdown callout (> [!NOTE]) usable from JSX, for application-state news - a failed save, a quota warning - that is not authored in a Markdown file. Give it a tone of note, tip, or caution; live makes it announced to screen readers as an interruption.

Viewport width
Phone22remthe floor, the narrowest this promises to work at
tanstacktanstack add https://adamjurek.com/r/tanstack/alert.jsonshadcnpnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/alert.json

Why it is built this way

Markdown already renders > [!NOTE] as this exact box; Alert exists so an application state can wear the same box without being written in Markdown first. role="alert" is opt-in through live rather than the default, because most alerts are read in place as part of the page, and a page full of assertive regions is a page that never stops talking to a screen reader.

What it does not do

It does not dismiss itself, queue, or stack. It renders while its condition is true and disappears when the caller stops rendering it - timing and dismissal are the host's job, the same way the failed save or the quota is.

Install commands are not written here

Anything in packages/ui/registry.ts gets its TanStack and shadcn commands attached automatically, so there is nothing to keep in sync.

Install

tanstack add https://adamjurek.com/r/tanstack/alert.json
shell
pnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/alert.json
shell
pnpm add @sushindustries/ui @sushindustries/atoms
shell

What you get

Version0.1.0
Categorycontent · Feedback
Filesalert.tsx
DependenciesNone
Tagscallout, no-deps

No runtime dependencies

It brings nothing with it beyond the stylesheet.