Rime

Alert

An inline message in a tone (info, success, warning, danger) or a quiet legal box for fixed wording, with an action and dismiss.

Alert sits in the flow of a page or form. It carries a title, body, an action (a retry), a badge and an optional reference code for approved wording. live makes it announce when it appears.

Installation

npx shadcn@latest add KezLahd/rime/alert

Also installs: base, icon.

Usage

import { Alert } from "@/components/ui";

<Alert tone="warning" title="Payment is processing">We will email you when the bank confirms it.</Alert>

Examples

Tones

Payment is processing

We will email you when the bank confirms it.

Couldn't save

Nothing was lost. Try again in a moment.

API

Generated from the component's TypeScript types and JSDoc (scripts/gen-ui-registry.mjs), so it always matches the source.

Alert

Alert props
PropTypeDefaultDescription
toneRequiredAlertTone
titleReactNode
childrenReactNode
actionReactNodeA button or link on the right (desktop) or below (mobile).
iconReactNode | false
badgeReactNodeSmall uppercase tag before the title: "Cold chain", "Awaiting MLR".
jobCodestringlegal only: the approval job code, set in mono under the copy.
livebooleanAnnounce on appearance. Use for banners that appear in response to an action (a failed save), not for ones present on page load.
onDismiss() => void
classNamestring

Theme tokens

Per-component tokens are undeclared by default, so the default shown is the fallback the CSS uses. Set one at :root (or in theme.css) to restyle every instance. Live values are read from this page, so they follow the Rime Studio.

Alert per-component tokens
TokenDefaultLive value
--alert-radiusvar(--r-md)…

System tokens it reads

Alert system tokens
TokenDefaultLive value
--blur-callouttokens.css…
--border-wtokens.css…
--danger-filltokens.css…
--danger-inktokens.css…
--danger-linetokens.css…
--densitytokens.css…
--focus-ringtokens.css…
--font-monotokens.css…
--info-inktokens.css…
--ink-bodytokens.css…
--ink-headingtokens.css…
--ink-mutedtokens.css…
--line-brandtokens.css…
--r-2xstokens.css…
--r-mdtokens.css…
--r-xstokens.css…
--rgb-brandtokens.css…
--rgb-brand-deeptokens.css…
--rgb-supporttokens.css…
--rgb-support-deeptokens.css…
--rgb-whitetokens.css…
--success-filltokens.css…
--success-inktokens.css…
--success-linetokens.css…
--text-bodytokens.css…
--text-microtokens.css…
--text-smalltokens.css…
--warning-filltokens.css…
--warning-inktokens.css…
--warning-linetokens.css…

Accessibility

  • live renders role="alert" (danger and warning) or role="status" (the rest); without live it is plain content, so it is not re-announced on every render.

Do and don't

Do

  • Say what happened and what to do next.

Don't

  • Don't use an Alert for transient confirmation; that is a toast.

For AI agents

This page as markdown, rendered from the same registry entry. Point an agent at it (or add .md to this page's URL), or at /llms.txt for the index.

Open alert.md