Components
QuizResult
Renders its children only once the funnel is complete.
Purpose
The outcome screen. Renders nothing while the funnel is in progress;
once the engine reaches "complete", renders its children with the full
answers map passed to a render-prop, so you can compute a score,
recommendation, or segment from everything collected.
Installation
pnpm dlx shadcn@latest add @quiz-ui/quiz-resultUsage
<QuizResult>
{(answers) => (
<p>
Recommended plan: {scorePlan(answers)}. Sending details to {answers.email}
.
</p>
)}
</QuizResult>Fixed content also works if you don't need the answers:
<QuizResult>
<p>Thanks for completing the quiz!</p>
</QuizResult>Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | ((answers: QuizAnswers) => ReactNode) | — | Rendered only once complete. |
className | string | — | Merged onto the wrapper. |
Notes
- Typically the last step's
typein yourQuizStepswitch — give the final step in yourQuizDefinitiona type like"result"with nonext, and render<QuizResult>for that case.