Dialog
Loading example…
Wraps DialogPrimitive.Root so focus is restored on close even when the
dialog is opened in a controlled way, without its own DialogTrigger.
Import
Section titled “Import”import { Dialog } from "@jcsoftdev/ui/overlays";Single-component entry points tree-shake to just this component: @jcsoftdev/ui/overlays/dialog.
export const Default: Story = { render: (args) => ( <Dialog> <DialogTrigger asChild> <Button variant="danger">Anular cita</Button> </DialogTrigger> <DialogContent {...args}> <CancelBody /> </DialogContent> </Dialog> ),};Source of the Storybook story.
| Prop | Type | Default | Description |
|---|---|---|---|
open |
boolean |
||
defaultOpen |
boolean |
||
onOpenChange |
((open: boolean) => void) |
||
modal |
boolean |
Traps focus, hides the page and locks scroll while open. Defaults to true. | |
children |
ReactNode |
* marks a required prop.
Storybook stories
Section titled “Storybook stories”- Default
- Open By Default
- Close Hit Area
- Large
- Blocking
- Controlled
- In Scoped Container
- In Scoped Preset
Source
Section titled “Source”packages/ui/src/overlays/dialog/dialog.tsx