Dialog

Overlays
Local guide ↗ import { Dialog } from "bits-ui"

Form dialog

A labelled modal form with controlled open state and predictable cancellation

Scrollable content

A bounded modal keeps its title and actions visible while the document body scrolls

Dialog.Portal moves the overlay and content to document.body by default, escaping local stacking contexts. Modal content traps focus, locks body scrolling, focuses the first focusable control on open, and restores focus to the trigger on close. Keep Dialog.Title and Dialog.Description inside the content so their generated IDs can label the dialog for assistive technology.

Escape and outside interaction close a dialog by default. Configure escapeKeydownBehavior or interactOutsideBehavior on Dialog.Content only when the workflow truly requires it; the corresponding event callbacks can prevent a single dismissal. Set trapFocus={false} or preventScroll={false} only with an alternative accessibility strategy.