Agents
Question Card
The agent asks several questions before it continues: one at a time with a count, lettered options, an optional free-text answer and a summary at the end.
Group: Agents. Exports: QuestionCard. Halaska addition with no shadcn/ui equivalent.
Usage
import { QuestionCard } from "./halaska-kit";
QuestionCard props
titlestring(default "Before Alpha continues"): Header line beside the agent mark (default: "Before Alpha continues")questions{ id: string, question: string, context?: string, options: { id: string, label: string, sub?: string }[], allowOther?: boolean }[](default QCARD_QUESTIONS): Questions in order (default: QCARD_QUESTIONS)skipLabelstring(default "Skip, use defaults"): Ghost action that hands the decision back to the agent (default: "Skip, use defaults")nextLabelstring(default "Next"): Primary action between questions (default: "Next")doneLabelstring(default "Continue"): Primary action on the last question (default: "Continue")otherLabelstring(default "Other"): Label of the free-text option when a question allows it (default: "Other")otherPlaceholderstring(default "Tell Alpha what you would prefer"): Placeholder of the free-text field (default: "Tell Alpha what you would prefer")skippedTextstring(default "Skipped. Alpha will go with its defaults."): Line shown after skipping (default: "Skipped. Alpha will go with its defaults.")onAnswer(questionId: string, optionId: string) => void: Fires when an option is picked; "other" for the free-text optiononComplete(answers: Record<string, { optionId: string, label: string }>) => void: Fires once with every answer when the last question is confirmedonSkip() => void: Fires when the user skips the remaining questions
Accessibility
- Each question's options form a radiogroup labelled by the question. Every option is a native button with the radio role and aria-checked.
- Arrow keys move between options and select them. Typing an option's letter picks it. The letters are shown as keyboard hints.
- Questions that are not on screen are hidden from assistive technology and from Tab. The count is a polite live region.
- The free-text field is a labelled input that receives focus when Other is picked.
Halaska UI · Components · Patterns · Screens · Install