Heads up
Your workspace is on the free plan. Upgrade to raise your rate limits.
Display a prominent message that needs the reader's attention — usually a warning, error, or non-dismissible system notice.
Alert is an inline, non-dismissible region. It sits in the document flow and
stays visible until the underlying condition changes. Reach for <Alert> when
the user needs to read the message before continuing, but not necessarily
act on it immediately.
Alert carries role="alert", which tells assistive technology to announce the
message as soon as it enters the DOM. Use it sparingly — every alert competes
for the same announcement channel.
import { Alert, AlertTitle, AlertDescription } from "@unkey/ui";
Use <Alert> for context that:
<Button variant="outline" color="danger"> plus body copy.For ephemeral feedback that appears after an action (saved, copied, deleted), reach for a toast instead. For blocking confirmation of a dangerous action, use a dialog.
The default variant is neutral. Use it for passive, informational context — something the reader should notice but isn’t a problem.
Your workspace is on the free plan. Upgrade to raise your rate limits.
Use warn for cautionary context: the user should pay attention because an
action is needed soon, or a non-fatal edge case has been detected. Warn does
not imply that anything is currently broken.
Your API key expires in 7 days. Rotate it now to avoid service interruption.
Use alert for destructive or failure context: something has gone wrong, or
the user is about to perform an irreversible action. Alert is the highest
visual weight and should be the rarest of the three.
We couldn’t reach our auth provider. Please try again in a few minutes.
<Alert> is a plain container. <AlertTitle> renders as a semi-bold
<h3>, and <AlertDescription> renders the body copy at a smaller size with
relaxed leading. Both are optional — you can render only the description (for
a one-line notice) or only the title (for a headline).
Anything else you pass as a child is rendered inline. A leading <svg> is
absolutely positioned in the top-left corner (the container reserves pl-7
for it); wrap titles and descriptions after the icon.
<Alert> renders a role="alert" live region. When the element first enters
the DOM, screen readers announce its text immediately, interrupting the
current announcement. Two implications:
For a non-interrupting live region (e.g. a “saved” indicator), use a plain
<div aria-live="polite"> instead.
<Alert> variant "default" | "warn" | "alert" Optional
Default "default" Semantic intent. default is neutral, warn signals caution (amber
border on an amber-tinted background), alert signals failure or
destruction (red border on a red-tinted background).
className string Optional Additional Tailwind classes. Merged with the variant classes via cn;
later classes win over earlier ones.
children ReactNode Optional Typically an <AlertTitle>, an <AlertDescription>, or both. A leading
<svg> is absolutely positioned in the top-left.
<AlertTitle>Renders as <h3> with medium weight and tight tracking.
className string Optional Additional Tailwind classes.
<AlertDescription>Renders as a <div> with small-caps text sizing and relaxed leading.
className string Optional Additional Tailwind classes.