Ordered world setup with validation, choices and submission.
Preview
Usage
Import the Questionnaire parts from @/components/ui/questionnaire. Declare ordered items on the root and matching QuestionnaireItem names, required flags and choices. The primary example uses required single-choice mode followed by a required text answer, then reads native FormData on submit.
Composition
Compose titles, choices/input, errors and navigation inside the root. QuestionnairePrevious, QuestionnaireNext, QuestionnaireSkip and QuestionnaireSubmit coordinate the primitive's active step. Set multiple on a choice step for checkbox answers; optional steps can be skipped. The retained world-setup playground includes optional multiple features and a freeform alternative. shortcuts="numbers" enables numbered choices.
API and accessibility
The installed primitive is pinned to @shadcn/react@0.3.1; do not substitute unrelated questionnaire APIs. The root ref is an HTMLFormElement and onSubmit receives the native form event. Text parts accept logical maxWidth and alignment, scale defaults to 2. Numbered navigation and the questionnaire arrangement are web adaptations; appearance claims apply only to recorded native constituents.
See the underlying API for shared semantics.
Installation
Component source
This is the component implementation. Its supporting styles, helpers and resources are also required. See complete manual installation.
"use client";
import { Questionnaire as Primitive } from "@shadcn/react/questionnaire";
import * as React from "react";
import { Button } from "./button";
import { Input } from "./input";
import { MinecraftProse } from "./minecraft-prose";
import { minecraftClasses as cn, minecraftStyle } from "./minecraft-render";
import { playMinecraftClick } from "./minecraft-sound";
import "./minecraft-checkbox.css";