quiz-ui
Components

QuizImageChoice

Visual, image-based single-select answer grid.

Purpose

For funnels where the answer is visual rather than text — style picks, product previews. Same underlying Radix RadioGroup as QuizChoiceGroup, laid out as an image grid instead of a card list.

Installation

pnpm dlx shadcn@latest add @quiz-ui/quiz-image-choice

Usage

<QuizImageChoice
  columns={3}
  options={[
    { value: "modern", label: "Modern", imageUrl: "/styles/modern.jpg" },
    { value: "rustic", label: "Rustic", imageUrl: "/styles/rustic.jpg" },
    { value: "minimal", label: "Minimal", imageUrl: "/styles/minimal.jpg" },
  ]}
/>

Props

PropTypeDefaultDescription
optionsQuizImageChoiceOption[]{ value, label, imageUrl } for each tile.
columns2 | 32Grid columns.
classNamestringMerged onto the grid wrapper.

Notes

  • Single-select only — there's no multiple variant of this component. If you need multi-select image tiles, compose QuizChoiceCheckbox-style markup yourself using useQuizAnswers() directly.

On this page