Skip to content
API reference

components/confirm-action

Import
import * as api from "@fungi.computer/caps/components/confirm-action";
Kind Export Description
type alias ConfirmActionProps A deliberate hold, or an exact phrase before a destructive action.
function ConfirmAction() Confirms once per gesture, owns pending/result feedback, and keeps failed confirmations available for retry. Type mode closes on success and restores focus through Dialog. A pending action cannot be dismissed or cancelled.

ConfirmActionPropstype alias

Section titled “ConfirmActionProps”
Signature
type ConfirmActionProps = object &
| {
mode: "hold";
phrase?: never;
}
| {
mode: "type";
phrase: string;
};

A deliberate hold, or an exact phrase before a destructive action.

Name Type Description
label string The action’s trigger label and dialog title.
confirmLabel string The destructive key’s label (and the hold gesture’s instruction).
onConfirm() () => Promise<void> Resolve on success; reject on failure. The component prevents concurrent calls.
error? string Caller-owned, safe-to-display failure copy; rejection details are never displayed.

ConfirmAction()function

Section titled “ConfirmAction()”
Signature
function ConfirmAction(__namedParameters): Element;

Confirms once per gesture, owns pending/result feedback, and keeps failed confirmations available for retry. Type mode closes on success and restores focus through Dialog. A pending action cannot be dismissed or cancelled.

Parameter Type
__namedParameters ConfirmActionProps

Element