All components

FEEDBACK / COMPONENTS

Alert

Explain a state and the next useful step.

Live component5 documented props

About alert

Alerts provide status feedback to a user that is either related to their actions and selections, or is otherwise informative. Great uses of alert include: Results of a user submitting a form or other action Providing brief follow up context Showing contextual information based on a selection Alerts can be: Shown in context Fixed and sticky at the top of the page Dismissed by the user Dismissed on a timer Static and not able to be dismissed

01

Anatomy

Shared parts, named consistently.

  1. 1
    ContainerRequired

    Styled container that uses color to get the user’s attention

  2. 2
    IconRequired

    Styled container that uses color to get the user’s attention

  3. 3
    TextRequired

    High level context for the Alert, provides instruction to the user

  4. 4
    Subtext

    Styled container that uses color to get the user’s attention

  5. 5
    Link

    Provides follow up context or otherwise is a relevant place to go based on user’s actions

  6. 6
    Dismiss

    Allows the Alert to be dismissed

Try the default

A working example with the shared V1 visual language.

When to use

Use semantic intent with an icon and clear text. Announce newly triggered errors; avoid repeatedly announcing persistent guidance.

Only included actions receive focus. A dismiss control has an explicit accessible name.

Related components

Source & adaptation

V1 semantic colors, DM Sans typography, compact controls, and responsive layouts. The API table describes this implementation; source design notes may use earlier API terminology.

components/ui.tsx