Modal
A dialog, side sheet or full-screen panel for a focused task.
Used in Coding Studio and Settings and billing.
- Use it for
- A focused task that blocks the page until done or dismissed.
Modal preview
Open the example, then use Escape to return to its trigger.
Installation
npm install @stackunseen/uiimport { Modal } from '@stackunseen/ui';@stackunseen/ui/styles.cssUsage and props
Use for a focused task without leaving the page. Keep open in application state and put the form or other content in children. Use header for a custom heading and footer for actions that stay visible while the body scrolls. Choose dialog, sheet or fullscreen with the layout prop.
openboolean- Whether the panel is open.
onOpenChange(open: boolean) => void- Update open when the trigger, close button or dismissal changes it.
titlestring- The accessible panel name. Also shown as the heading unless you supply header.
descriptionstring- A short task explanation. It remains visible below the default or custom heading.
triggerReactNode- One trigger element that accepts button props and a ref.
childrenReactNode- Your content in the scrollable body.
layout'dialog' | 'sheet' | 'fullscreen' (optional)- Choose the panel presentation. Defaults to dialog.
headerReactNode (optional)- Replaces the visible title. The title prop still supplies the accessible name.
footerReactNode (optional)- Your actions below the scrolling body. Set open to false from a cancel handler.
classNamestring (optional)- Adds a class to the panel surface in every layout.
styleCSSProperties (optional)- Inline styles for the panel surface, such as a custom width.
All props
Loading…
For your coding agent
Give the agent this page instead of a screenshot. The prompt wraps the page with the install and import lines and the rule that your server, not a click, completes an action.
- Contract
- open · onOpenChange · title · description · trigger · children · layout? · header? · footer? · className? · style?
- Keeps honest
- Keep whether it’s open, and any draft, in your app. Sheet and fullscreen are layouts of Modal, not separate components.
- MCP
read_component "Modal"on the docs endpoint
Keyboard and customization
Keyboard
Opening moves focus into the dialog. Tab remains inside; Escape closes it and returns focus to the trigger. The title and description name the task.
Customization
Change shared colors, spacing, corners and icons with the theme. Use the component's supported props to adapt its content and layout. Customization guide and Theme Studio