AsterUIDocsv1.0.2

Docs / Component reference

AlertDialog & yield* confirmDestructive()

Give someone a chance to back out before a destructive action. The caller can wait for the answer with yield* confirmDestructive().

Alert dialog example

Install

sh
npx @fierst/ui@1.0.2 add alert-dialog

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

Exports from ./ui/alert-dialog: AlertDialog, confirmDestructive.

Download the registry source for alert-dialog 1.0.2.

API contracts

ts
export function* AlertDialog(
  props: {
    open?: any;
    title: string;
    description: string;
    confirmPhrase?: string;
    confirmLabel?: string;
    cancelLabel?: string;
    onConfirm: () => void;
    onCancel?: () => void;
  },
  ctx: Ctx,
)

export function* confirmDestructive(opts: {
  title: string;
  description: string;
  confirmPhrase?: string;
  confirmLabel?: string;
}): Generator<View, boolean, any>