@brickslab./ui-webQuiz
Single-select question with radio or card variant and optional free-text other option.
Radio variant
Card variant
With «Other» option
Props
| Prop | Type | Défaut | Requis | Description |
|---|---|---|---|---|
value | string | — | — | Selected option id. |
onChange | (v: string) => void | — | ✓ | Called with the selected id (or the typed text when allowOther is active). |
options | SingleChoiceOption[] | — | ✓ | Array of { id, label, description?, disabled? }. |
variant | "radio" | "card" | "radio" | — | Radio rows or card grid layout. |
allowOther | boolean | false | — | Adds a free-text «Other» option at the end. |
otherLabel | string | "Other…" | — | Placeholder/label for the other option. |
disabled | boolean | false | — | Disables all interactions. |
Override rapide
Tous les paramètres listés dans cette table sont overrideables via les props. Utilisez ce squelette comme point de départ.
<MyComponent
value="..."
onChange="..."
options={[]}
variant="radio"
allowOther={false}
otherLabel="Other…"
disabled={false}
/>valueonChangeoptionsvariantallowOtherotherLabeldisabled