ReferenceComponents

choice

A question the user answers by tapping: one pick, or several.

A question on the page, answered with a tap. choice is how the copilot 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.

Which items are you returning?
Aero Glide 243 · VoltCourt Low42 · BoneRunning socks, 3 pairsM
Return 2 items

Re-rendered in the browser from the SDK’s own scales. Not a screenshot.

Shapes

  • single, as chips or a list: a tap is the answer.
  • multi, as a list: rows tick on and off and the button under the list sends them, between min_selected (1 by default) and max_selected (all by default).
  • other adds a last row the user can write their own answer in.
  • skip adds 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 the copilot 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.

PropTypeRequiredConstraints
questionstringYes1 to 120 characters.
hintstringNoUp to 160 characters.
modesingle | multiYesNone
stylechips | listNoNone
optionsarrayYes2 to 12 entries.
options[].idstringYes1 to 64 characters.
options[].labelstringYes1 to 40 characters.
options[].subtitlestringNoUp to 80 characters.
options[].iconstringNoUp to 40 characters.
options[].image_urlstringNoNone
min_selectedintegerNo1 to 12.
max_selectedintegerNo1 to 12.
otherobjectNoNone
other.labelstringYes1 to 40 characters.
other.placeholderstringNoUp to 80 characters.
skipobjectNoNone
skip.labelstringYes1 to 24 characters.
submit_labelstringNo1 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).

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.