DialogContent
Loading example…
Keep it a flex column (the default): the sticky close anchor and the pinned DialogHeader and
DialogFooter rely on it. A wrapper between them and this element, such as a <form>, needs
flex min-h-0 flex-col too.
Import
Section titled “Import”import { DialogContent } 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 |
|---|---|---|---|
classNames |
Partial<Record<DialogContentPart, string>> |
Per-part classes merged with cn; consumer classes win. className still targets the content and is merged last. |
|
width |
"md" | "lg" |
"md" |
|
material |
"solid" | "glass" | "glass-clear" | "liquid" | "liquid-clear" |
Surface material. Omitted keeps the default for this layer; "glass" and "glass-clear" are frosted glass, "liquid" and "liquid-clear" Liquid Glass (with its fallbacks), "solid" forces an opaque surface. Liquid options go in style (liquidStyle() f… |
|
blocking |
boolean |
false |
While a mutation is in flight: Escape, outside click and the close button are disabled so half-saved state is not lost. |
closeLabel |
string |
Accessible label of the close button. | |
container |
HTMLElement | null |
Portal target. Defaults to document.body; pass an element to keep a scoped data-style. |
|
forceMount |
boolean |
||
onOpenAutoFocus |
((event: Event) => void) |
||
onCloseAutoFocus |
((event: Event) => void) |
||
onEscapeKeyDown |
((event: KeyboardEvent) => void) |
||
onPointerDownOutside |
((event: PointerDownOutsideEvent) => void) |
||
onFocusOutside |
((event: FocusOutsideEvent) => void) |
||
onInteractOutside |
((event: InteractOutsideEvent) => void) |
||
intent |
string |
||
intentKey |
string |
* marks a required prop.
It also accepts the native props of the element or primitive it renders (for example className, id, aria-* and event handlers).
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