---
title: "Questionnaire"
description: "A step-by-step question flow with progress and selectable choices, for onboarding surveys and an AI assistant's clarifying questions."
plan: Free
docs: https://ui.edbn.me/docs/components/questionnaire
---

# Questionnaire

A step-by-step question flow with progress and selectable choices, for onboarding surveys and an AI assistant's clarifying questions.

## Installation

```bash
npx shadcn@4.19.0 add https://ui.edbn.me/r/questionnaire.json
```

## Dependencies
- npm: @shadcn/react@^0.3.0, lucide-react@^1.33.0
- edbn: edbn-base, button

## Usage

```tsx examples/questionnaire-basic.tsx
"use client";
import {
  Questionnaire,
  QuestionnaireActions,
  QuestionnaireChoice,
  QuestionnaireChoices,
  QuestionnaireDescription,
  QuestionnaireItem,
  QuestionnaireProgress,
  QuestionnaireSubmit,
  QuestionnaireTitle,
} from "@/components/ui/questionnaire";

export default function QuestionnaireBasicPreview() {
  return (
    <Questionnaire
      items={[
        {
          name: "role",
          required: true,
          choices: [{ value: "design" }, { value: "engineering" }],
        },
      ]}
      defaultItem="role"
      onSubmit={(event) => event.preventDefault()}
      className="max-w-dialog"
    >
      <QuestionnaireProgress>Question 1 of 1</QuestionnaireProgress>
      <QuestionnaireItem name="role" required>
        <QuestionnaireTitle>What is your role?</QuestionnaireTitle>
        <QuestionnaireDescription>
          Choose the closest match.
        </QuestionnaireDescription>
        <QuestionnaireChoices>
          <QuestionnaireChoice value="design">Design</QuestionnaireChoice>
          <QuestionnaireChoice value="engineering">
            Engineering
          </QuestionnaireChoice>
        </QuestionnaireChoices>
        <QuestionnaireActions>
          <QuestionnaireSubmit>Finish</QuestionnaireSubmit>
        </QuestionnaireActions>
      </QuestionnaireItem>
    </Questionnaire>
  );
}
```

## Files
- components/ui/questionnaire.tsx (325 lines)

## For agents
- Base theme, once per project: npx shadcn@4.19.0 add https://ui.edbn.me/r/edbn-base.json
- MCP server with search, items, examples and source: https://ui.edbn.me/mcp
- Every page and item: https://ui.edbn.me/llms.txt
