Dialog

Modal surface on bits-ui Dialog. Opens with a fade-and-zoom tokenized to 100ms, traps focus while visible, restores the trigger on Esc or outside click.

Usage

Without close button

Scrollable

Wrap long content in ScrollArea with a max-height — the header and footer stay pinned while the body scrolls.

Nested dialog

Open a second dialog from inside the first — bits-ui stacks the overlays and tracks focus restoration in order. Use sparingly: prefer collapsing into a single confirm flow when you can.

Dialog.Root props

Inherits bits-ui Dialog.Root props via spread. Listed here are the most common bindings.

PropTypeDescription
boolean (bindable)Controls visibility. Two-way bindable.
(open: boolean) => voidFires when the open state changes for any reason.

Dialog.Content props

PropTypeDescription
booleanRenders the absolute-positioned top-right ghost close button.
ComponentProps<Dialog.Portal>Forwarded to the internal portal — useful for scoping the mount target.
stringMerged onto the content surface via tailwind-merge.