Overlays

Dialog

@xui/dialog

A modal surface over a dimmed backdrop. Backdrop, focus trap, scroll lock and focus restore come from @xui/core/overlay; none of that is exercised in jsdom, so these stories are the real check.

Install

pnpm add @xui/dialog

Add the barrel to a standalone component's imports:

import { XuiDialogImports } from '@xui/dialog';

@Component({
  imports: [XuiDialogImports],
  // …
})

Examples

Default

Loading preview…

Scrolling

Loading preview…

API

XuiDialogBody

componentxui-dialog-body

The scrollable body of a dialog.

Inputs

NameTypeDefaultclassClassValueThe user-defined classes. Merged last so they win over the base classes.''

XuiDialogFooter

componentxui-dialog-footer

The footer bar of a dialog, where the actions live.

Inputs

NameTypeDefaultclassClassValueThe user-defined classes. Merged last so they win over the base classes.''align'end' | 'between' | 'start'How the footer's buttons are distributed: packed at the end (the default), at the start, or pushed apart.'end'

XuiDialog

componentxui-dialog

A modal surface centred over a dimmed backdrop.

Inputs

NameTypeDefaultclassClassValueThe user-defined classes on the surface. Merged last so they win.''titlestring | nullThe dialog's heading, also used as its accessible name. Without one the header renders only if showCloseButton is on.nulliconstringName of a registered @ng-icons icon, shown beside the title.sizeXuiDialogSizeMaximum width of the panel.this.config.sizecanEscapeKeyClosebooleanLet Escape close the dialog.this.config.canEscapeKeyClosecanOutsideClickClosebooleanLet a click on the backdrop close the dialog. Turn it off when the dialog holds unsaved work.this.config.canOutsideClickCloseshowCloseButtonbooleanShow the × in the header.this.config.showCloseButtonopentwo-waybooleanOpen state. Works bound (controlled) or via show()/close().false

Methods

show(): voidclose(): void

Source

libs/ui/dialog/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.