Skip to content

Questionnaire

Pro

Asks one question at a time, with choices or text answers. People can skip, use keys, and check every answer on a review step before they send.

  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 9, 2026 · Pro license

Playground

Loading the preview

Props

Needs your Pro API key in GELATIN_UI_PRO_TOKEN. Set it up

Pro itemAPI key required

Questionnaire needs a Pro API key

Try the live preview for free. With Pro, the add command above puts the source in your project.

Files it adds
48
More Pro items, one API key
+327
Your coding agent runs it
1 cmd

$79$129once, for life

Already have Pro? Sign in to set up your API key.

Put each question in an item with a title and choices. Put the buttons in the actions and the thank-you text in QuestionnaireComplete.

first-week-survey.tsx

Questionnaire

<div>
PropTypeDefaultDescription
itemstring—The name of the question on screen (controlled).
defaultItemstring—The name of the first question to show (uncontrolled), for a resumed flow.
onItemChange—
itemsreadonly QuestionnaireItemDefinition[]—The questions in order, for server rendering: the engine then knows the count before the questions mount. A rendered question that is not here is left out (a dev warning says so). List the choices of each question too: a choice that is not here gets no shortcut key.
shortcuts"letters""numbers"—Keys that check a choice: letters (A–Z) or numbers (1–9). Use numbers for scripts other than Latin.
reviewbooleanfalseAdds the review step after the last question: the Submit there reads "Review answers".
density"compact""default""default"default: the page look (24px between parts, a 20px title). compact: a tighter look for a panel in an app (the Question Flow of the AI category): 12px between parts, the 14/20 title of a panel (the Card sm title), 6px between choices, and a line over the actions with 12px above them.
onSubmitAnswers—Sends the answers. While its promise runs, the phase is submitting (the Submit shows its loading look); when it resolves, complete; when it rejects, the answers stay and QuestionnaireSubmitError shows. Without it, the form submits as a plain form (onSubmit, an action). Catch and log your own errors inside it, then throw again to show the error. onSubmit runs first: a preventDefault there stops this call.
onAnswersChange—Runs after each change of an answer (and a skip), with the answers the form would send.
labels—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QuestionnaireProgress

<div>
PropTypeDefaultDescription
classNamestring—
glowboolean—A soft halo in the fill color (glow, @gelatin-ui/glow). Default: false.
tone"destructive""info""neutral""success""warning"—The fill color: default (primary), or a status for a task whose state has a meaning: success done, warning slow or nearly full, info a neutral step, destructive failed. Color is never the only signal: say the state in the label or value.
From Base UIProgress.RootBase UI docs
aria-valuetextstring—A string value that provides a user-friendly name for aria-valuenow, the current value of the progress bar.
formatNumberFormatOptions—Options to format the value.
getAriaValueText—Accepts a function which returns a string value that provides a human-readable text alternative for the current value of the progress bar.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QuestionnaireCount

<span>
PropTypeDefaultDescription
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

QuestionnaireContent

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QuestionnaireItem

<div>
PropTypeDefaultDescription
invalidbooleanfalse
nameRequiredstring—
multipleboolean—
onStatusChange—
requiredbooleanfalse
maxChoicesnumber—With multiple: the most choices one can check. At the limit the others refuse a check.
minChoicesnumber—With multiple: the fewest choices that count as an answer. Next (and every key that goes on) stops with "Choose at least N." in the error line while 1 to N − 1 are checked. No check at all is the required rule.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QuestionnaireTitle

<div>
PropTypeDefaultDescription
renderRenderProp<RenderState>—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QuestionnaireDescription

<div>
PropTypeDefaultDescription
renderRenderProp<RenderState>—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QuestionnaireChoices

<div>
PropTypeDefaultDescription
renderRenderProp<QuestionnaireChoicesState>—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QuestionnaireChoice

<div>
PropTypeDefaultDescription
defaultCheckedboolean—
renderRenderProp<QuestionnaireChoiceState>—
checkedboolean—
disabledboolean—
onChange—
valueRequiredstring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QuestionnaireChoiceDescription

<span>
PropTypeDefaultDescription
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

QuestionnaireInput

<div>
PropTypeDefaultDescription
type"date""datetime-local""email""month""number""password""search""tel""text""time""url""week"—
size"default""lg""sm""xs""lg"
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QuestionnaireTextarea

<div>
PropTypeDefaultDescription
size"default""lg""sm"—The padding of the box: sm, default, or lg (the height follows the text).
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QuestionnaireError

<div>
PropTypeDefaultDescription
render—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QuestionnaireActions

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QuestionnairePrevious

<div>
PropTypeDefaultDescription
size"default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs"—
variant"dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary""outline"
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QuestionnaireSkip

<div>
PropTypeDefaultDescription
size"default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs"—
variant"dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary""ghost"
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QuestionnaireNext

<div>
PropTypeDefaultDescription
size"default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs"—
variant"dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary""default"
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QuestionnaireSubmit

<div>
PropTypeDefaultDescription
busyboolean—The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading.
size"default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs"—
variant"dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary""default"
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

QuestionnaireKeyHint

<span>
PropTypeDefaultDescription
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

QuestionnaireReview

<section>
PropTypeDefaultDescription
...props<section> attributes—Every other attribute goes to the <section>, with a ref.

QuestionnaireReviewTitle

<h2>
PropTypeDefaultDescription
...props<h2> attributes—Every other attribute goes to the <h2>, with a ref.

QuestionnaireReviewList

<ul>
PropTypeDefaultDescription
children—Your own rows (<li>), from the answers read when the review opened.
...props<ul> attributes—Every other attribute goes to the <ul>, with a ref.

QuestionnaireSubmitError

<p>
PropTypeDefaultDescription
...props<p> attributes—Every other attribute goes to the <p>, with a ref.

QuestionnaireComplete

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Use it when each question needs the full focus of the reader.
  • Pass onSubmitAnswers: a promise shows the loading Submit, and a reject keeps the answers.
  • Set review to show all answers, with Change on each row, before the send.
  • For a short form that people fill at a glance, use a Field.
  • For a single yes or no, use a Checkbox.
Up ArroworDown ArrowMoves between the choices.
AorBorCPicks the choice with that letter. With shortcuts="numbers", the keys are 1 to 9.
EnterGoes to the next question.
ModEnterGoes on from a long answer, where Enter adds a line.
Question
popup · the next question comes in on the popup enter curve
Choice mark
fade · the check and the dot fade and scale in

Built with

Installs with Questionnaire

  1. AddedQuestionnaire, with Button, Checkbox, Input, Kbd, Progress, Rolling Number, Textarea.
Open the release