Contents
Garden HandbookComponent referencegarden choice

Component reference · choice

Present two or three option cards with an icon, headline value, and preference label, plus an optional fallback button and selection reply.

← Component reference · Usage: choice

1Examples

Code

```garden choice
title: Where should we meet next month?
items:
  - icon: idea
    value: $6 each
    text: Corner café, one drink included
    label: Prefer the atmosphere
    reply: Café it is. We will book the long table by the window.
  - icon: book
    value: Free
    text: Library meeting room, booking needed
    label: Prefer the quiet
    reply: Library it is. We will book the room at the start of the month.
none:
  label: Neither / not sure
  reply: No problem. We will share a few more venues in the group chat.
caption: Illustrative only. Venues and prices are made up.
```

Preview

Where should we meet next month?

Illustrative only. Venues and prices are made up.

2Syntax

```garden choice
title:      # optional, question
items:      # required, 2–3 suggested
  - icon:   # optional, one of 23 icons
    value:  # recommended, big value
    text:   # recommended, short note
    label:  # optional, preference tag
    reply:  # optional, reply
none:       # optional, fallback button
  label:    # button text
  reply:    # optional, reply
caption:    # optional, caption
```

3Fields

Fence header: ```garden choice (snippet trigger ;gchoice). Renders as an accessible role="radiogroup" with arrow-key navigation; cards sit side by side on desktop and stack vertically in a single column on narrow screens. Invalid YAML or unknown top-level keys report garden-yaml on the block.

FieldRequiredDefaultAllowed Values & LimitsDescription
titleOptional""stringQuestion or heading above the option cards
itemsRequired[]object[] (2 to 3 items recommended, not checked)Option cards
items[].iconOptionalnone (draws no icon)one of the 23 built-in icon namesLine icon at the top of the card (shares the same 23 icon names as garden list)
items[].valueRecommendednonestring or numberProminent price, figure, or short headline on the card
items[].textRecommendednonestringOne-sentence description of the option
items[].labelOptionalnonestringPreference tag with a dot indicator at the bottom of the card
items[].replyOptional""stringResponse shown below the group when this card is selected
noneOptionalnone{ label: string, reply?: string }Full-width single-line fallback button underneath the cards (such as "Neither / not sure") and its selection reply
captionOptionalnonestringCaption below the component

4Limits & errors

  • Apart from the shared garden-yaml, this component has no error codes of its own; values marked "not checked" in the table never report an error.
Contents