choice
A question the user answers by tapping: one pick, or several.
A question on the page, answered with a tap. choice is how Rendel asks for the one thing it needs before it can answer well, and how it lets someone pick several things at once: one pick from a few chips ("Where do you mostly run?"), or one or several from a list whose rows can carry a subtitle and a picture ("Which items are you returning?").
The pick goes back by id, not as a sentence, and the server checks it against the block it drew: an id the block does not offer, more picks than it allows, or a block already answered is refused. Once answered, the block folds into the question and what was picked.
Drawn live in your browser with the SDK’s own sizes and colours, not a screenshot.
Rendered natively by the Flutter SDK since 0.39.0 and the web SDK since 0.16.0. A build that does not declare it is never offered it.
Shapes
single, aschipsor alist: a tap is the answer.multi, as alist: rows tick on and off and the button under the list sends them, betweenmin_selected(1 by default) andmax_selected(all by default).otheradds a last row the user can write their own answer in.skipadds a way to answer without picking ("No preference").
When not to use it
Not for a payment method or anything else a confirmation should carry. Not for something Rendel can look up itself. One question at a time: a second follows on the next page.
Props
Every block also carries type and a required fallback_text of 1 to 300 characters.
| Prop | Type | Required | Constraints |
|---|---|---|---|
question | string | Yes | 1 to 120 characters. |
hint | string | No | Up to 160 characters. |
mode | single | multi | Yes | None |
style | chips | list | No | None |
options | array | Yes | 2 to 12 entries. |
options[].id | string | Yes | 1 to 64 characters. |
options[].label | string | Yes | 1 to 40 characters. |
options[].subtitle | string | No | Up to 80 characters. |
options[].icon | string | No | Up to 40 characters. |
options[].image_url | string | No | None |
min_selected | integer | No | 1 to 12. |
max_selected | integer | No | 1 to 12. |
other | object | No | None |
other.label | string | Yes | 1 to 40 characters. |
other.placeholder | string | No | Up to 80 characters. |
skip | object | No | None |
skip.label | string | Yes | 1 to 24 characters. |
submit_label | string | No | 1 to 24 characters. |
On the wire
{
"id": "blk_61",
"type": "choice",
"fallback_text": "Which items are you returning: Aero Glide 2, Court Low or the socks?",
"props": {
"question": "Which items are you returning?",
"hint": "Order #4821 · delivered 7 Oct",
"mode": "multi",
"style": "list",
"options": [
{ "id": "glide43", "label": "Aero Glide 2", "subtitle": "43 · Volt", "image_url": "https://…" },
{ "id": "court42", "label": "Court Low", "subtitle": "42 · Bone" },
{ "id": "socks", "label": "Running socks, 3 pairs" }
],
"submit_label": "Return"
}
}The pick reaches the model as Selected on blk_61: Aero Glide 2 (glide43), Court Low (court42).
On the wire the tap is a selection: { "block_id": "blk_61", "ids": ["glide43", "court42"] }. An answer written in the other row goes as ids: [] with other_text, and reads Selected on blk_61: wrote "…". A skip goes as ids: [] and reads Selected on blk_61: skipped.
Accessibility
A single pick is a radio group and a multi pick a group of checkboxes, both named by the question. How many are picked is announced as it changes.