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

<app-dialog> ├── [appDialogTrigger] └── <app-dialog-content> ├── [appDialogHeader] │ ├── [appDialogTitle] │ └── [appDialogDescription] ├── content ├── [appDialogFooter] (optional) └── [appDialogClose] (optional)

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

<app-dialog>

Inputs

InputTypeDefaultDescription
idstring | undefinedgeneratedUnique identifier used to connect the dialog parts.
idsPartial<DialogElementIds> | undefined—Overrides generated identifiers for individual parts.
aria-labelstring | undefined—Accessible label used when no visible title labels the dialog.
openboolean | undefined—Open state when controlled. Supports Angular two-way binding.
defaultOpenbooleanfalseInitial open state when uncontrolled.
modalbooleantrueEnables modal behavior.
closeOnInteractOutsidebooleantrueCloses the dialog after an allowed outside interaction.
closeOnEscapebooleantrueCloses the dialog when Escape is pressed.
preventScrollbooleantruePrevents document scrolling while the dialog is open.
trapFocusbooleantrueKeeps keyboard focus inside the open dialog.
restoreFocusbooleantrueRestores focus after the dialog closes.
initialFocusEl(() => HTMLElement | null) | undefined—Returns the element that should receive initial focus.
finalFocusEl(() => HTMLElement | null) | undefined—Returns the element that should receive focus after closing.
persistentElements(() => Element | null)[] | undefined—Elements that remain interactive while the modal is open.
role"dialog" | "alertdialog" | undefined"dialog"Sets the dialog's accessible role.
triggerValuestring | null | undefined—Active trigger value when controlled. Supports two-way binding.
defaultTriggerValuestring | null | undefined—Initial active trigger value when uncontrolled.

Outputs

OutputTypeDescription
openChangeboolean | undefinedEmits the updated controlled open state.
triggerValueChangestring | null | undefinedEmits the updated controlled trigger value.
escapeKeyDownKeyboardEventEmits when Escape is pressed.
focusOutsideDialogFocusOutsideEventEmits when focus moves outside the dialog.
interactOutsideDialogInteractOutsideEventEmits for an interaction outside the dialog.
pointerDownOutsideDialogPointerDownOutsideEventEmits for a pointer-down event outside the dialog.
requestDismissCustomEventEmits when another layer requests that this one dismiss.
openChangeDetailsDialogOpenChangeDetailsEmits detailed information about an open-state change.
triggerValueChangeDetailsDialogTriggerValueChangeDetailsEmits detailed information about a trigger-value change.

[appDialogTrigger]

InputTypeDefaultDescription
valuestring | undefined—Value used to identify this trigger when activated.

<app-dialog-content>

InputTypeDefaultDescription
showCloseButtonbooleantrueShows the built-in close button in the content panel.
classstring""Additional classes applied to the inner content panel.

Context, Providers, and Utilities

ExportAngular API
DialogRootProviderDirective that provides an externally created dialog API through value.
DialogContextStructural directive [dialog-context] exposing the root API.
useDialog(options)Creates the signal-backed dialog machine in an Angular injection context.
injectDialogContext()Injects the nearest dialog root context.
injectDialogContextCarrier()Injects the context carrier used across portals.
DialogImportsReadonly collection containing the dialog UI and context helpers.

Types

ExportDescription
DialogApiConnected dialog state and actions.
DialogElementIdsOverrides for generated dialog part IDs.
DialogMachinePropsConfiguration accepted by the underlying dialog machine.
DialogOpenChangeDetailsDetails emitted by openChangeDetails.
DialogTriggerValueChangeDetailsDetails emitted by triggerValueChangeDetails.
DialogFocusOutsideEventEvent emitted by focusOutside.
DialogInteractOutsideEventEvent emitted by interactOutside.
DialogPointerDownOutsideEventEvent emitted by pointerDownOutside.
UseDialogOptionsOptions accepted by useDialog.
UseDialogPropsDialog props supplied by the useDialog context callback.
UseDialogReturnSignal-backed dialog machine returned by useDialog.