Alert Dialog
Asks for an explicit response before an action that can lose data.
Preview
Local preview. It doesn't affect real accounts, environments, or run data.
Compare the same example at each size and density. Switching keeps input values and selection state. Size guidance and comparisons
No preview action taken.
Usage
Confirm an action that's hard to undo, such as deleting or discarding. Point Content.initialFocus at the safe cancel button.
Don't label the action with a neutral OK or Yes. Name the specific action instead. Don't treat an outside click as a response. Wait for an explicit choice.
Size: SizeProvider size="small" resizes the whole composition, including portals. The default size is Default. Size guidance and comparisons
Anatomy
Root → Trigger → Content → Header(Title / Description) + Footer(Cancel / Action)
Keyboard and accessibility
Focus starts on the safe cancel action and stays inside the dialog. Escape acts as cancel.
Give each control a name that describes its purpose. Connect error messages to their controls, and signal state with more than color. Automated checks don't replace manual keyboard and assistive technology testing.
Example code
Shared components take their styles from design tokens. Each example sets its own composition and accessibility attributes. The calling screen defines callbacks, refs, and product data.
Key API
The table lists the common wrapper's main props. See the package type declarations for the full types.