AlertButton
One button of an alert or a prompt, as the app lists it and as the call resolves with the one the user picked.
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 AlertButton = {
text?: string;
/** At most one button is `cancel`. */
style?: AlertButtonStyle;
/** iOS: the button Return picks, shown in bold. */
preferred?: boolean;
};Members 3
| Name | Type | Required | Description |
|---|---|---|---|
text | string | No | — |
style | SpecButtonStyle | No | At most one button is cancel. |
preferred | boolean | No | iOS: the button Return picks, shown in bold. |
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.