Alert
Inline messages about a page, section or form: a tinted fill, a hairline border and a coloured title and icon, so the tone reads at a glance.
Subtle (default)
Section titled “Subtle (default)”Add the source to a shadcn project
npx shadcn@latest add https://docs.atomus.io/r/alert.jsonOpen in v0Installs the component source, its CSS and the Atomus tokens into components/atomus/. How the registry works
Outline — on tinted or grey surfaces
Section titled “Outline — on tinted or grey surfaces”Solid — blocking issues only
Section titled “Solid — blocking issues only”Small and flush
Section titled “Small and flush”Billing
Plan, invoices and payment method.
In Figma
Section titled “In Figma”From guidelines/components/message-alert.md · Open in Figma: Alert
Properties, variants and anatomy of the Figma components. React props use the same names.
Inline alert about a page, section or form. Tinted fill, hairline border, coloured title and icon. Colours: Brand, Gray, Error, Warning, Success.
Variants: 10
| Property | Type / options |
|---|---|
| Title | text |
| Description | text |
| Show description | boolean (on) |
| Actions | boolean (on) |
| Close | boolean (on) |
| Style | Subtle · Outline · Solid |
| Color | Brand · Gray · Error · Warning · Success |
Code adds one option that is not a Figma variant yet: Size sm · md (size="sm", default md). Colours come from the --color-alert-<color>-bg · border · title · icon component tokens.
Style
- Subtle (default) — tinted background, hairline border. Use it almost everywhere.
- Outline — white surface, coloured border and a soft shadow. Use it on tinted or grey surfaces (bg-secondary, filled cards) where a tint would disappear.
- Solid — full-colour fill. Only for blocking, page-level issues (account suspended, payment failed, data loss).
Size
- md (default) for pages and cards; sm for dense UI, forms, table toolbars and side panels.
import { Alert } from '@stanvision/atomus-react';
<Alert color="warning" title="Trial ends in 3 days" onClose={dismiss}> Add a payment method to keep your projects.</Alert>Props at a glance
Section titled “Props at a glance”Full types and defaults are in React API at the end of the page.
color—brand·gray·error·warning·success(aliases:info→ brand,neutral→ gray,danger→ error).variant—subtle(default, tinted) ·outline(white, for tinted or grey surfaces) ·solid(blocking issues only). Figma: Style.size—md(default) orsmfor dense UI;flushremoves the radius and side borders for full-bleed placement.titleandchildren(Figma: Title, Description);actions— up to two small buttons;onClose(Figma: Close).- Each colour has its own icon, so meaning never depends on colour alone. Colours come from the
--color-alert-*component tokens.
Don’t
- Don’t stack more than two alerts; use toasts for transient confirmations.
- Don’t use
solidfor routine messages.
Design guidance
Section titled “Design guidance”From the Figma guidelines.
Do
- Pick the colour by meaning: Brand = info, Gray = neutral, Error, Warning, Success.
- Lead with a short title; put detail in the description.
- Give a clear next step: one link or up to two small buttons.
Forbidden
- Never stack several alerts.
- Never use alerts for marketing.
- Never use Solid for routine messages — it shouts.
- Never auto-dismiss an alert — use Toast for transient messages.
React API
Section titled “React API”Generated from react/src/components by scripts/gen-react-api.mjs — the same tables agents read in guidelines/components/message-alert.md.
Use only these props; anything else is not part of the API.
import { Alert } from '@stanvision/atomus-react'; — source: react/src/components/Alert.tsx
| Prop | Type | Default | Description |
|---|---|---|---|
title |
ReactNode |
— | Figma: Title |
children |
ReactNode |
— | Figma: Description (+ Show description) |
color |
'brand' | 'gray' | 'error' | 'warning' | 'success' | 'info' | 'neutral' | 'danger' |
'brand' |
Figma: Color. Aliases: info = brand, neutral = gray, danger = error. |
variant |
'subtle' | 'outline' | 'solid' |
'subtle' |
Figma: Style. subtle (default) — tinted fill and hairline border. outline — white surface with a coloured border; use on tinted or grey surfaces. solid — full-colour fill; only for blocking, page-level issues. |
size |
'sm' | 'md' |
'md' |
Figma: Size — md (default) or the compact sm for dense UI, forms and side panels. |
flush |
boolean |
false |
Removes the radius and side borders so the alert can span the full width of a card or page edge. |
actions |
ReactNode |
— | Figma: Actions — up to two small buttons |
onClose |
() => void |
— | Figma: Close |
icon |
ReactNode |
— | Replaces the default status icon |
Also accepts every native <div> attribute (id, role, onClick …), except title, color, which are replaced above.