Skip to content
Twentyfirst UIPro

Alert

Overlays · Alert, Button

View as Markdown

Inline banner for a state the page is in: a warning, a failure, a note. Lives in the page, unlike a toast.

Props: tone ("info" | "success" | "warning" | "danger" | "highlight"), title, children (one sentence), icon (override), action (one small Button), onDismiss.

  • One alert per page section, at the top of what it concerns. Two warnings: merge them.
  • Title says the state, body says the consequence or the next step.
  • Warning and danger are announced to screen readers; info and success are polite.
  • Never use an alert for something that already happened and needs no action: that's a toast.
Bank feed syncs every 4 hoursNew transactions show up here and get matched automatically.
Domain verifiedhalo.app is ready to send mail.
3 agent drafts need your review

Props

Alert

PropTypeNotes
tone?Exclude<Tone, "neutral">
title?ReactNode
icon?IconName
action?ReactNode
onDismiss?() => void
children?ReactNode
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.

Button

PropTypeNotes
variant?"primary" | "secondary" | "soft" | "ghost" | "danger" | "danger-solid"
size?"md" | "sm"
icon?IconName
iconRight?IconName
disabled?boolean
type?"button" | "submit" | "reset"
onClick?(e: MouseEvent<HTMLButtonElement>) => void
children?ReactNode
asChild?booleanRender the single child element (a link, a router Link) with the button's look instead of a <button>.
id?string
name?stringForm field name and value, sent with the form when this button submits it.
value?string
form?stringThe id of the form this button belongs to, when it sits outside it.
title?string
tabIndex?number
autoFocus?boolean
aria-label?string
aria-labelledby?string
aria-describedby?string
aria-expanded?boolean | "true" | "false"For disclosure and menu triggers: whether what the button controls is open.
aria-controls?string
aria-haspopup?boolean | "true" | "false" | "menu" | "listbox" | "tree" | "grid" | "dialog"
aria-pressed?boolean | "true" | "false" | "mixed"For toggle buttons.
aria-current?boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time"
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.