Actions and overlays
Dialog
components/ui/dialogA modal on the native dialog element, for confirmations and short forms.
Dialog live demo
Craft notes
- Built on the native dialog element: focus is trapped and Escape closes it
- Focus returns to the control that opened it
- Opens with a soft swell and two chimes, and drops away when it closes
Play it
Open it with the keyboard, press Escape, and notice where focus lands.
Sounds: dialog
Variants
Every prop combination the component supports. The chip on each card is the exact props it passes.
Confirmation
title="Discard changes?"A destructive choice with a way out.
Announcement
footer={<Button>Got it</Button>}One action that acknowledges news.
Short form
children={<Input />}A field inside, with validation before saving.