Dialog
UI SDK Dialog parts: focus trap, Escape, focus restore, dismissible and controller support.
Example
dialog-demo.tsxCopy code
Installation
Copy code
Usage
ImportCopy code
API reference
DialogTrigger
Takes every prop of UI SDK DialogTrigger except aria-label, ButtonLookProps.
DialogBackdrop
DialogContent
| Prop | Type | Default |
|---|---|---|
size`sm` 24rem, `md` 32rem (default), `lg` 48rem, `xl` 72rem; `full` fills its container less `--floating-offset`. | DialogSize | "md" |
sheetOn narrow screens it rises from the bottom as a full-width sheet; `false` keeps it centered. | boolean | true |
Also takes every prop of UI SDK DialogContent.
DialogHeader
Takes <div> attributes and render.
DialogBody
Takes <div> attributes and render.
DialogFooter
Takes <div> attributes and render.
DialogTitle
DialogDescription
DialogClose
Takes every prop of UI SDK DialogClose except aria-label, ButtonLookProps.
Other exports
DialogbackdropClassNamecontentClassNamecreateDialogControllerdialogContentVariantsuseFocusReturnfocusedElementmayReturnFocususeFocusAboveKeyboarduseKeepPageStilluseRecordFocusMoveuseRecordOpeneruseVisualViewportBoxtype DialogContentPropstype DialogSizetype FocusMemoryAccessibility
- Focus moves in and is trapped; Escape closes; focus returns to the trigger.
- Named by DialogTitle and described by DialogDescription.
- Opaque reading surface in every theme, and a bottom sheet on narrow screens.
Agent actions
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.