Questionnaire: Auto-advance
With autoAdvance, picking a single answer moves on after a short pause, so you can answer with 1–5 alone. Changing an earlier answer never jumps ahead, and the last question never submits by itself.
This adds the example as components/examples/questionnaire/auto-advance.tsx, together with the Questionnaire component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/questionnaire-auto-advance.jsonTo add only the component, follow the Questionnaire installation.
Props in this example
The Questionnaire props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
autoAdvanceMoves on 350ms after a single answer is picked for the first time. | boolean | false |
shortcutsAdds a key shortcut to every answer. | "letters" | "numbers" | – |
| Prop | Type | Default |
|---|---|---|
nameThe form field name. | string | – |
required | boolean | false |
| Prop | Type | Default |
|---|---|---|
value | string | – |
Every prop is in the Questionnaire API reference.
See them all, with keyboard support and accessibility notes, on the Questionnaire page.
- ButtonButtons in every variant and size, with a built-in loading, success and error flow that skips the spinner for fast requests.
- InputA text input with three sizes, invalid and read-only states, native validation styling and a 16px touch font so phones never zoom in.
- KbdKey caps for shortcuts that show the right symbols on every platform, read them out properly and press down with the real keys.
- MotionThe easing curves, durations and reduced-motion check every component animates with, plus hooks for size morphs and sliding highlights.
- Number flowAnimated numbers where only the changed digits spin, with any Intl format and locale.
- CalendarA date grid for single, range and multiple selection, with sliding months, range previews and touch-sized days.