Import

import-dialog.ts
import {
NuiDialog,
NuiDialogActions,
NuiDialogClose,
NuiDialogDescription,
NuiDialogTitle,
} from '@needless-ui/angular/dialog';

NuiDialog

Turns a native <dialog> into a Needless UI dialog.

Selector
dialog[nuiDialog]
Exported as
nuiDialog
NuiDialog: Properties
NameTypeDefaultDescription
openTwo-waybooleanfalseWhether the dialog is open. Bind it with [(open)].
modalInputbooleantrueOpens as a modal, with a backdrop and an inert page behind it.
dismissibleInputbooleantrueWhether Escape and backdrop clicks close the dialog.
sizeInput'sm' | 'md' | 'lg''md'Maximum width: sm (24rem), md (32rem) or lg (44rem).
enterInputNuiEnterHow it arrives: zoom, fade, drop, rise, unfold, flip, swing, slide or none.
motionInputNuiMotionThe spring it moves with: snappy, bouncy, jelly, elastic, lazy, mechanical or none.
springInputNuiSpringAny spring, as { stiffness, damping, mass }, compiled to CSS at runtime. It overrides motion.
cornersInputNuiCornersThe shape of its corners: round, squircle, bevel, scoop, notch or square.
radiusInputNuiRadiusHow big its corners are: none, small, medium, large or full.
densityInputNuiDensityHow much room it takes: compact, regular or roomy.
closedOutputstringEmits the return value each time the dialog closes. It’s empty when the dialog was dismissed.
closeMethod(returnValue?: string) => voidCloses the dialog with an optional return value.

Customization inputs you leave unset follow the nearest data-nui-* attribute. See the customization guide.

NuiDialogTitle

The dialog’s title. It gets an id and becomes the dialog’s aria-labelledby.

Selector
[nuiDialogTitle]

NuiDialogDescription

A short description, referenced by the dialog’s aria-describedby.

Selector
[nuiDialogDescription]

NuiDialogActions

A row of buttons at the bottom of the dialog, aligned to the end.

Selector
[nuiDialogActions]

NuiDialogClose

Closes the surrounding dialog when clicked.

Selector
[nuiDialogClose]
NuiDialogClose: Properties
NameTypeDefaultDescription
nuiDialogCloseInputstring''The value the dialog closes with, emitted by (closed).