Skip to content

ApprovalPromptProps

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

Props shared by every ztui React component (plus each component’s own props).

optional actions?: ApprovalAction[]

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

Action buttons. Defaults to DEFAULT_APPROVAL_ACTIONS.


optional autoFocus?: boolean

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

Focus the action row as soon as the gate appears, so the keyboard is ready (arrow between actions, Enter to choose) without Tabbing to it first. Defaults to true — a permission gate is modal. Set false to leave focus where it was (e.g. several gates on screen at once).


optional bordered?: boolean

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

Draw a border around the prompt. Defaults to true.


optional calls?: ApprovalCall[]

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

Batch mode: the tool calls to approve. When set, the prompt lists each call with a per-row allow/deny toggle and a batch action row.


optional children?: ReactNode

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

Detail body for a single-call prompt (a command preview or diff).

ComponentProps.children


optional className?: string

Defined in: react/components/types.ts:24

Space-separated class names (currently advisory; no CSS cascade).

ComponentProps.className


optional denyOnEscape?: boolean

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

Whether Esc denies (single: the deny action; batch: deny all). Default true.


optional disabled?: boolean

Defined in: react/components/types.ts:52

Marks the widget (and its descendants) as inert: not focusable, ignores key/mouse input, and interactive controls render in a muted style. A disabled container propagates to every control inside it.

ComponentProps.disabled


optional focusable?: boolean

Defined in: react/components/types.ts:40

Allow this widget to take keyboard focus.

ComponentProps.focusable


optional focusOnClick?: boolean

Defined in: react/components/types.ts:46

When a click lands on this container (its padding, border, or a non-focusable child), move focus to its first focusable descendant — so clicking a Form/Panel/Box hands focus to its first field. Off by default.

ComponentProps.focusOnClick


optional hoverInterest?: boolean

Defined in: react/components/types.ts:66

Opt-in hint that this widget cares about passive hover movement.

ComponentProps.hoverInterest


optional id?: string

Defined in: react/components/types.ts:22

Stable identifier, handy for tests and lookups.

ComponentProps.id


optional label?: string

Defined in: react/components/types.ts:36

Structural/accessible label (also the tab title inside TabContainer).

ComponentProps.label


optional onAction?: (id, value?) => void

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

Fired with an action’s id; value is the typed text for an input action.

string

string

void


optional onClick?: (ev) => void

Defined in: react/components/types.ts:54

Pointer click.

any

void

ComponentProps.onClick


optional onDragEnd?: (x, y, moved) => void

Defined in: react/components/types.ts:72

Drag released; moved is false for a tap with no movement.

number

number

boolean

void

ComponentProps.onDragEnd


optional onDragMove?: (x, y) => void

Defined in: react/components/types.ts:70

Pointer moved while dragging from this widget.

number

number

void

ComponentProps.onDragMove


optional onDragStart?: (x, y) => void

Defined in: react/components/types.ts:68

Pointer-drag lifecycle; moved is false for a tap with no movement.

number

number

void

ComponentProps.onDragStart


optional onKey?: (ev) => void

Defined in: react/components/types.ts:58

Key event while focused; set ev.handled to consume it.

any

void

ComponentProps.onKey


optional onMatch?: (pattern) => void

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

Fired in batch mode when an “Allow matching” pattern is chosen (a listed pattern or a typed custom one), so the host can persist a standing rule. The matching calls are also flipped to allow in the list.

string

void


optional onMouseDown?: (ev) => void

Defined in: react/components/types.ts:56

Pointer pressed (any button); the event carries button and x/y.

any

void

ComponentProps.onMouseDown


optional onMouseEnter?: (ev) => void

Defined in: react/components/types.ts:62

Pointer entered this widget’s region.

any

void

ComponentProps.onMouseEnter


optional onMouseLeave?: (ev) => void

Defined in: react/components/types.ts:64

Pointer left this widget’s region.

any

void

ComponentProps.onMouseLeave


optional onResolve?: (decisions) => void

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

Fired in batch mode with the final per-call decision map (on Apply / all).

Record<string, "allow" | "deny">

void


optional onScroll?: (ev) => void

Defined in: react/components/types.ts:60

Wheel / scroll event.

any

void

ComponentProps.onScroll


prompt: string

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

The question, e.g. Allow Bash to run `npm test`? or "Run 3 tools?".


optional ref?: Ref<Widget>

Defined in: react/components/types.ts:30

Captures the underlying widget instance (React 19 ref-as-prop). Defaults to the base Widget; narrow it with a cast when you need a subclass field, e.g. ref={inputRef as React.Ref<InputWidget>}.

ComponentProps.ref


optional style?: WidgetStyles

Defined in: react/components/types.ts:32

Inline styles for this widget — see the Styling guide.

ComponentProps.style


optional theme?: string

Defined in: react/components/types.ts:34

Re-theme this subtree; descendants resolve $tokens against it.

ComponentProps.theme