AsterUIDocsv1.0.2

Docs / Component reference

Dialog & yield* confirmDialog()

Open a separate task while keeping the underlying page in place. The caller can supply the actions or wait for a confirmation.

Dialog example

Install

sh
npx @fierst/ui@1.0.2 add dialog

Registry dependencies: theme, button, icon. Package dependencies: @lucide/icons.

Exports from ./ui/dialog: Dialog, ConfirmDialogOptions, confirmDialog.

Download the registry source for dialog 1.0.2.

API contracts

ts
export function Dialog({
  id,
  open,
  title,
  description,
  footer,
  showClose = true,
  onClose,
  class: extraClass,
  children,
}: {
  id?: string;
  open?: any;
  title?: string;
  description?: string;
  footer?: View;
  showClose?: boolean;
  onClose?: () => void;
  class?: string;
  children?: View;
})

export interface ConfirmDialogOptions {
  title: string;
  description?: string;
  confirmLabel?: string;
  cancelLabel?: string;
  danger?: boolean;
}

export function* confirmDialog(opts: ConfirmDialogOptions): Generator<View, boolean, any>