Documentation

Asgard

Getting started

Theming

Guides

Layout

Docking

Inputs & forms

Button

Switch

Checkbox

Radio

Select

Slider

TextBox

Upload

ImageCropper

Pickers

Color picker

Calendar

Time picker

DateTime input

Data display

Card

Accordion

Typography

Progress

DataTable

TreeView

SyntaxColor

MarkdownRenderer

Terminal

Layout & docking

Grid

Splitter

SDiv

Dock

Theme switcher

Media query

Feedback & overlays

Alert

Toast

Tooltip

Popups

Drawer

FloatingPanel

FloatingWindow

Navigation & chrome

Breadcrumb

Stepper

Toolbar

Ribbon

ContextMenu

FeatureTour

Documentation

Asgard

Getting started

Theming

Guides

Layout

Docking

Inputs & forms

Button

Switch

Checkbox

Radio

Select

Slider

TextBox

Upload

ImageCropper

Pickers

Color picker

Calendar

Time picker

DateTime input

Data display

Card

Accordion

Typography

Progress

DataTable

TreeView

SyntaxColor

MarkdownRenderer

Terminal

Layout & docking

Grid

Splitter

SDiv

Dock

Theme switcher

Media query

Feedback & overlays

Alert

Toast

Tooltip

Popups

Drawer

FloatingPanel

FloatingWindow

Navigation & chrome

Breadcrumb

Stepper

Toolbar

Ribbon

ContextMenu

FeatureTour

Feedback & overlays

Promise-based confirm / prompt / custom dialogs.

A promise-based popup system for modal confirmations, prompts, and custom dialogs via a hook API.

Key features:

  • usePopups hook with confirm, prompt, and custom methods
  • All methods return promises for clean async/await patterns
  • confirm with customizable labels and danger variant
  • prompt with input validation and default values
Loading preview…
When to use it
  • Destructive-action confirmations
  • Quick single-field prompts
  • Custom modal content with actions
Properties
PropTypeDefaultDescription
confirm(config)Promise<boolean>Shows a confirmation dialog and resolves to true if confirmed, false if cancelled.
config.messagestringThe confirmation message displayed in the dialog body.
config.titlestringOptional title for the confirmation dialog header.
config.confirmLabelstringCustom label text for the confirm button.
config.cancelLabelstringCustom label text for the cancel button.
prompt(config)Promise<string | null>Shows a text input prompt and resolves to the entered string, or null if cancelled.
config.defaultValuestringPre-filled value for the prompt input field.
config.validation(value: string) => string | nullValidation function returning an error message string or null if valid.
Notes
  • Wrap your application in PopupsProvider to enable the popup system throughout the component tree.
  • All popup methods return promises that resolve when the user responds, making them ideal for use with async/await in event handlers.
  • The usePopups hook provides confirm, prompt, and custom methods for different dialog types.
Presets