Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Approval Card

ProNew

The question an agent asks before it acts: options, a custom answer, and a folded record of the decision.

Installation

pnpm dlx shadcn@latest add @viewport/approval-card

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
question*string

What the agent is asking.

—
descriptionstring

Context under the question.

—
options*ApprovalOption[]—
allowCustomboolean

Adds a free-text answer as the last choice.

false
confirmLabelstring

Label for the confirm button.

"Continue"
onSubmit(answer: string) => void

Called with the chosen option's value, or the typed text for a custom answer.

—
onSkip() => void

Called when the question is skipped. Omit to hide the skip button.

—
classNamestring—

Accessibility

  • Options are a Radix radio group: arrow keys and number keys both select.
  • The question labels the group; the result is announced as a status.
  • Enter submits from anywhere in the card.