Questionnaire owns the ordered items, active item, answer state, validation,
progress, and navigation. The containing page, card, dialog, or drawer owns
close and cancellation behavior, persistence, transport, and branching.
QuestionnaireItem renders a fieldset, and QuestionnaireTitle renders its
legend. Descriptions and active errors are associated with the current item,
and invalid items and answer controls expose aria-invalid.
Fixed choices preserve native radio and checkbox behavior. Progress is exposed
as a named progressbar, navigation uses real buttons, and inactive items and
actions are hidden and inert. Successful navigation focuses the newly active
item; failed validation focuses an available answer control.
Always give QuestionnaireInput an accessible name with a visible label,
aria-label, or aria-labelledby. A placeholder is not a label. See the
Questionnaire accessibility guide
for labeling custom compositions and the complete keyboard behavior.
The behavior in Questionnaire comes from the @shadcn/react package. To use
it directly with your own markup and styles, see
Questionnaire in the React docs.
The props, data attributes, and render states for every part are documented on
the Questionnaire API reference.
The styled components inherit the corresponding unstyled props. Navigation
components also accept Button size and variant props, and
QuestionnaireActions is a styled-only layout helper.