Approval Card

Human-in-the-loop questions the agent asks before acting.

Installation

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

Add the Ward registry to components.json once:

"registries": {
  "@ward": "https://ward.so/r/{name}.json"
}

Or install from the URL with no configuration: npx shadcn@latest add https://ward.so/r/approval-card.json

Usage

import ApprovalCard from "@/components/ward/ApprovalCard";
<ApprovalCard
  questions={[
    { q: "Which environment should I deploy to?", type: "radio", options: ["Staging", "Production"] },
    { q: "Which checks should run first?", type: "check", options: ["Unit tests", "Lint", "Type check"] },
  ]}
  resettable={false}
  onSubmitted={(answers) => console.log(answers)}
/>

Props

PropTypeDefaultDescription
questionsApprovalQuestion[]QUESTIONSQuestions shown one at a time, each with its text, a radio or check type and its options.
labelsPartial<ApprovalLabels>-Overrides for the Skip, Continue and Send buttons, the custom-answer placeholder and the confirmation message.
onSubmitted(answers: Record<number, number[]>) => void-Called with the chosen option indices, keyed by question index, when the answers are sent.
onAnswerChange(questionIndex: number, answer: number[]) => void-Called whenever the selected options for a question change.
resettablebooleantrueShows a 'Start over' button after sending that returns the card to its first question.
variantstring"Default"Accepted for registry parity; ApprovalCard has no visual variants.

Ward · Version 1.1.0 · Registry manifest