Dialog
A modal window composed from Root, Trigger, Content, Header, Footer, Title, Description, and Close.
When to use
- Use when
- A focused task that needs the rest of the page out of the way, such as a form or a detail view.
- Avoid when
- The content could live on the page, or the dialog would open another dialog.
Installation
The source lands in src/components/ui/dialog.tsx, along with any Shelf items it builds on, and .shelf/lock.json records what was installed. It's yours to edit.
Usage
Built on
- Packages
@base-ui/react,@stylexjs/stylex- Accessibility
- Focus, keyboard, and ARIA behavior come from Base UI.
- Figma
- Optional native Figma library. See Designers.
Verified
- Size
- 2.1 kB gzipped on its own, 28 kB with the Shelf items and packages it builds on. JS and CSS in a production build, without React.
- Accessibility
- Axe passes on 7 stories
- Behavior
- 7 interaction tests in Storybook
- React Doctor
- React Doctor finds nothing