Search documentation

Search the documentation and open a page.

A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/dialog

Composition

Dialog ├── DialogTrigger └── DialogContent ├── DialogHeader │ ├── DialogTitle │ └── DialogDescription ├── content ├── DialogFooter (optional) └── DialogClose

Examples

Default

Loading...

In A Form

Loading...

No Close Button

Loading...

Review Transfer

Loading...

Schedule Report

Loading...

Scrollable Content

Loading...

Settings

Loading...
Loading...
Loading...

Upgrade Plan

Loading...

Welcome

Loading...

API Reference

Dialog

PropTypeDefaultDescription
idstring | undefined—Unique identifier used to connect the component parts.
idsElementIds | undefined—Overrides generated identifiers for individual parts.
trapFocusboolean | undefined—Configures trap focus.
preventScrollboolean | undefined—Configures prevent scroll.
modalboolean | undefined—Configures modal.
initialFocusEl(() => MaybeElement) | undefined—Configures initial focus el.
finalFocusEl(() => MaybeElement) | undefined—Configures final focus el.
restoreFocusboolean | undefined—Configures restore focus.
closeOnInteractOutsideboolean | undefinedtrueConfigures close on interact outside.
closeOnEscapeboolean | undefinedtrueConfigures close on escape.
role"dialog" | "alertdialog" | undefined—Configures role.
openboolean | undefined—Whether the component is open when controlled.
defaultOpenboolean | undefined—Initial open state when uncontrolled.
onOpenChange((details: OpenChangeDetails) => void) | undefined—Runs when open changes.
triggerValuestring | null | undefined—Configures trigger value.
defaultTriggerValuestring | null | undefined—Configures default trigger value.
onTriggerValueChange((details: TriggerValueChangeDetails) => void) | undefined—Runs when trigger value changes.

Context, Hooks, and Types

ExportAPI
DialogContextRender-prop component that exposes component state and actions.
DialogRootProviderProvides an externally created API to the component tree.
useDialogCreates or accesses the component API.
useDialogContextReturns the nearest component API.
DialogOpenChangeDetailsType for the details object passed to the matching change callback.