AlertOptions
What an alert says and which buttons it offers, and the base a prompt adds its text field to.
Usage
Mark a destructive choice in an alert.
This type is used by alert
// Mark a destructive choice in an alert.
import { alert, type AlertButtonStyle } from 'kuito';
const choice = (text: string, style: AlertButtonStyle) => ({ text, style });
const picked = await alert({
title: 'Delete this draft?',
buttons: [choice('Cancel', 'cancel'), choice('Delete', 'destructive')],
});
if (picked?.style === 'destructive') console.log('deleted');Type declaration
export type AlertOptions = {
title: string;
message?: string;
buttons?: readonly AlertButton[];
/** Android: tapping outside or Back dismisses the alert. False by default. */
cancelable?: boolean;
/** iOS: light or dark regardless of the app's appearance, as CSS's `color-scheme`. */
colorScheme?: 'light' | 'dark';
};Members 5
| Name | Type | Required | Description |
|---|---|---|---|
title | string | Yes | — |
message | string | No | — |
buttons | readonly AlertButton[] | No | — |
cancelable | boolean | No | Android: tapping outside or Back dismisses the alert. False by default. |
colorScheme | "light" | "dark" | No | iOS: light or dark regardless of the app's appearance, as CSS's color-scheme. |
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.