Questionnaire
Playful, production-shaped questionnaire flows with single choice, multiple choice, custom item renderers and a completed answer summary.
Guided flows
Each example gets a full row so the question, options and navigation can breathe. The flows use different data, states and themes; two also assign a custom questionItemRender callback.
What are we shipping this week?
Pick the outcome that would make Friday feel successful.
Misty forest · Sunrise hike + fancy picnic · The dog has the spare ticket.
Custom option renderer
The superpower and sundae examples assign questionItemRender as a JavaScript property. The questionnaire still owns selection, validation, keyboard shortcuts and navigation; the callback only supplies the expressive label area.
import { html } from 'lit'
const icons = {
teleport: '🚀',
pause: '⏸️',
translate: '🐙',
snacks: '🍕',
}
questionnaire.questionItemRender = ({ option, selected }) => html`
<span class="option-label">${icons[option.value]} ${option.label}</span>
<span class="option-description">${selected ? 'Excellent choice — locked in!' : option.description}</span>
`