Getting Started
Overview
Installation
Theme
Forms
Basic Inputs
Custom Inputs
Select
Components
Components
78
Micro Charts
Navigation
Libraries
Content Editor
Data View
Form Builder
Image Designer
Kanban Board
PDF Viewer
Video Player
Latest npm version of @ngstarter-ui/componentsWeekly npm downloads of @ngstarter-ui/components
Buy License

Dialog

Dialog opens a focused modal workflow above the current page. Open it with Dialog.open(ComponentOrTemplate, config), pass data through the config, and return a result with DialogRef.close(...) or ngs-dialog-close. Dialog content is usually structured with ngs-dialog-title, ngs-dialog-content, and ngs-dialog-actions.

Use Dialog for forms, editing records, creating objects, settings, detail views, wizard-like steps, scrollable content, and custom modal workflows where users must complete or close the task before returning to the page. Do not use it for a short binary confirmation, global message, mobile bottom action panel, or side inspector.

Dialog Service

The Dialog service is used to open modal dialogs.

Methods

NameDescription
open(componentOrTemplateRef, config?)Opens a dialog with the specified component or template.
closeAll()Closes all open dialogs.

Dialog Configuration

The DialogConfig object configures dialog behavior, accessibility, sizing, and container affordances such as the built-in close button.

PropertyTypeDescription
dataanyData passed to the dialog component.
widthstringDialog width.
heightstringDialog height.
minWidth / minHeightstring | numberMinimum dialog dimensions. Numeric values are treated as pixels.
maxWidth / maxHeightstring | numberMaximum dialog dimensions. Numeric values are treated as pixels.
hasBackdropbooleanControls whether the dialog opens with a backdrop.
backdropClass / panelClassstring | string[]Additional classes applied to the backdrop or overlay panel.
disableClosebooleanPrevents the dialog from closing when the backdrop is clicked or Escape is pressed.
autoFocusboolean | stringControls which element receives focus when the dialog opens.
restoreFocusbooleanRestores focus to the previously focused element when the dialog closes.
ariaLabel / ariaLabelledBy / ariaDescribedBystring | nullAccessible labeling and description options for the dialog.
role'dialog' | 'alertdialog'ARIA role for the dialog container.
closeOnNavigationbooleanControls whether the dialog closes when browser navigation occurs.
showCloseButtonbooleanShows the built-in icon close button in the dialog container. Defaults to false.

Directives & Components

DialogTitle

Dialog title. Automatically generates a unique ID for ARIA.

InputTypeDescription
idstringUnique title identifier.

DialogActions

Container for action buttons at the bottom of the dialog.

InputTypeDescription
align'start' | 'center' | 'end'Action button alignment. Defaults to 'end'.

DialogClose

Directive for buttons that close the dialog.

InputTypeDescription
ngsDialogCloseanyResult used when closing the dialog.