Skip to content

ApprovalAction

Defined in: react/components/agent/approval-prompt.tsx:29

One action in an approval prompt — a button, an inline dropdown (menu), or a free-text entry (input). Generic by design: id is whatever string you want reported back, so prompts aren’t limited to allow/deny.

optional icon?: string

Defined in: react/components/agent/approval-prompt.tsx:35

Leading glyph (e.g. "✓", "✗"). Part of the label.


id: string

Defined in: react/components/agent/approval-prompt.tsx:31

Reported to onAction when chosen.


optional input?: boolean | { placeholder?: string; }

Defined in: react/components/agent/approval-prompt.tsx:49

When set, choosing this action opens an inline text field instead of firing immediately — for “let me type my own pattern”. On submit, the typed value is delivered (single mode: onAction(id, value); batch “custom match”: the value is treated as a glob and onMatch(value) fires). Pass an object to set the field’s placeholder.


optional key?: string

Defined in: react/components/agent/approval-prompt.tsx:37

Single-character keyboard shortcut (case-insensitive).


label: string

Defined in: react/components/agent/approval-prompt.tsx:33

Button / menu-row text.


optional menu?: ApprovalAction[]

Defined in: react/components/agent/approval-prompt.tsx:41

Sub-actions; when present this action renders as a dropdown ().


optional tone?: ApprovalTone

Defined in: react/components/agent/approval-prompt.tsx:39

Colour emphasis. Defaults to "default".