Weftv0.4.0
GitHubFigma
Blade AI
Display · Alertstable

Alert

Communicates important information inline: significant changes, outcomes or explanations. Five intents, subtle or intense emphasis, an optional action and dismiss button. Use sparingly, since alerts interrupt the main flow.

Preview

#preview

Change the options and the code follows. Show code opens the React snippet.

alert-example.tsx
import { Alert } from "@blade-ai/weft/components/alert";

export function UpdateNotice({ onUpdate, onClose }: Props) {
  return (
    <Alert
      title="New version available"
      actionLabel="Update now"
      onAction={onUpdate}
      onDismiss={onClose}
    >
      Version 2.4 adds faster settlements and a new reports tab.
    </Alert>
  );
}

All states

#all-states

Every intent in subtle and intense emphasis, plus full width, from the Alert artboard.

Alert · 5 intents × 2 emphasis · full width
Subtle · neutral
Intense · neutral
Subtle · positive
Intense · positive
Subtle · negative
Intense · negative
Subtle · notice
Intense · notice
Subtle · information
Intense · information
Full width · dismissible

Props

#props

Read from the component source. Booleans are is-prefixed. A star marks a required prop.

Prop
Type
Default
Description
intent
"neutral" | "positive" | "negative" | "notice" | "information"
"neutral"
Meaning of the alert; sets colour and the live-region role.
emphasis
"subtle" | "intense"
"subtle"
"subtle" is a tinted surface; "intense" is a solid fill with white text.
title
ReactNode
—
Short heading.
children
ReactNode
—
Supporting text.
actionLabel
string
—
Label of the inline action button. Requires onAction.
onAction
() => void
—
Fires when the action is pressed.
onDismiss
() => void
—
Shows a dismiss button when set.
dismissLabel
string
"Dismiss"
Accessible name of the dismiss button.
isFullWidth
boolean
false
Stretch to the container instead of the default 420px.

Usage

#usage

Short rules for choosing and writing alert.

Do
Choose the intent by meaning: negative and notice for urgent, positive and information for the rest.
Write a short title; make the description stand on its own.
Prefer subtle emphasis, and keep intense for critical messages.
Don't
Stack several alerts on one screen.
Rely on colour alone; every alert has its own icon and text.
Put essential information only in the title.

Accessibility

#accessibility

Negative and notice alerts announce immediately (role="alert"); the others announce politely (role="status").

Keyboard
Key
Action
Tab
Moves to the action and dismiss buttons.
Enter / Space
Activates the focused button.
ARIA
Element
Role / attribute
When
Alert
role="alert" (negative, notice) · role="status" (others)
Set by intent.
Dismiss button
aria-label = dismissLabel
Only when onDismiss is set.
Icon
aria-hidden="true"
Decorative; the text carries the meaning.