API reference
Headless dialog exposes a root controller plus structural directives for backdrop, panel, trigger, close controls, and accessible labeling. It owns the modal behavior, while you own the rendered shell.
Root directive
| Directive | Selector | Key API | Purpose |
|---|---|---|---|
TngDialog | [tngDialog] | open, defaultOpen, dismissible, closeOnBackdropClick, closeOnEscape, restoreFocus, autoFocus, trapFocus, lockScroll, size | Owns modal lifecycle, focus management, scroll locking, and close reason outputs. |
TngDialog | [tngDialog] | openChange, closed | Emits controlled open-state changes and close reasons for analytics or workflows. |
Slot directives
| Directive | Selector | Slot | Purpose |
|---|---|---|---|
TngDialogBackdrop | [tngDialogBackdrop] | dialog-backdrop | Overlay surface, outside-dismiss target, and modal centering layer. |
TngDialogPanel | [tngDialogPanel] | dialog-panel | Dialog container with role, size state, and ARIA wiring. |
TngDialogTrigger | [tngDialogTrigger] | dialog-trigger | Opens the owned dialog and participates in focus restoration. |
TngDialogClose | [tngDialogClose] | dialog-close | Closes the owned dialog and can emit an explicit close reason. |
TngDialogTitle | [tngDialogTitle] | dialog-title | Registers the accessible dialog label when the panel is present. |
TngDialogDescription | [tngDialogDescription] | dialog-description | Registers the accessible description for screen reader context. |
TngDialogActions | [tngDialogActions] | dialog-actions | Stable styling hook for footer action rows. |
Behavior and events
closedemits'backdrop' | 'close-button' | 'escape' | 'programmatic'.autoFocuslets owners prefer the panel, the first focusable, or no automatic focus change.trapFocusandrestoreFocusare enabled by default for modal-safe keyboard flow.ariaLabel,ariaLabelledby, andariaDescribedbysupport custom naming when title/description nodes are not used.dismissibleis the top-level guard for Escape and backdrop dismissal.