Questionnaire
A step-by-step set of questions with progress and a summary.
Help us set up your workspace
Question 1 of 4When to use
- Collecting structured answers, such as onboarding or intake.
- Answers can change the next question.
When not to use
- A single field; use a form field.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/questionnaire
Adds its 6 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
Questionnaire
4 props
PropTypeDefault
title *string—
questions *readonly Question[]—
onSubmit *(answers: Readonly<Record<string, string | string[]>>) => void | Promise<void>—
classNamestring—
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It exposes status, progressbar, radiogroup, radio and alert semantics, with aria-hidden, aria-label, aria-valuenow, aria-valuemin, aria-valuemax and aria-describedby kept in step with state. Changes that matter are announced through a live region.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/questionnaire.mdThe index of every part is at /llms.txt.