AlertOptions
What an alert says and which buttons it offers, and the base a prompt adds its text field to.
Verwendung
Mark a destructive choice in an alert.
Dieser Typ wird verwendet von 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');Typdeklaration
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';
};Mitglieder 5
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
title | string | Ja | — |
message | string | Nein | — |
buttons | readonly AlertButton[] | Nein | — |
cancelable | boolean | Nein | Android: tapping outside or Back dismisses the alert. False by default. |
colorScheme | "light" | "dark" | Nein | iOS: light or dark regardless of the app's appearance, as CSS's color-scheme. |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.