Skip to content

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.

New tokens available
Atomus 4.0 adds brand and radius modes. Read the changelog.
Scheduled maintenance
The editor is read-only on Sunday 02:00–03:00 UTC.
Trial ends in 3 days
Add a payment method to keep access to your workspace.
Changes saved
Your workspace settings are up to date.
variant="subtle" · brand · gray · error · warning · successLive · light and dark follow the theme switch

Add the source to a shadcn project

npx shadcn@latest add https://docs.atomus.io/r/alert.jsonOpen in v0

Installs the component source, its CSS and the Atomus tokens into components/atomus/. How the registry works

New tokens available
Atomus 4.0 adds brand and radius modes. Read the changelog.
Scheduled maintenance
The editor is read-only on Sunday 02:00–03:00 UTC.
Trial ends in 3 days
Add a payment method to keep access to your workspace.
Changes saved
Your workspace settings are up to date.
variant="outline" on bg-tertiaryLive · light and dark follow the theme switch
New tokens available
Atomus 4.0 adds brand and radius modes. Read the changelog.
Scheduled maintenance
The editor is read-only on Sunday 02:00–03:00 UTC.
Trial ends in 3 days
Add a payment method to keep access to your workspace.
Changes saved
Your workspace settings are up to date.
variant="solid"Live · light and dark follow the theme switch
Two-factor authentication is off
Unsaved changes
Leave this page and your edits are lost.
Published to production
size="sm"Live · light and dark follow the theme switch

Billing

Plan, invoices and payment method.

Your card expires next month
Update it before 1 November to avoid interruptions.
flush — full-bleed inside a cardLive · light and dark follow the theme switch

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>

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) or sm for dense UI; flush removes the radius and side borders for full-bleed placement.
  • title and children (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 solid for routine messages.

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.

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.