patternverse
library workspace

Patternverse/Documentation

Language guide Components Functions

Components

Language 1

Explore a building block. Inspect its contract. Try the result.

Questions, displays, flow controls, and extension widgets, with editable examples powered by the editor’s runtime. AI examples use sample replies; your test responses stay temporary.

20 of 20 components

Questions & choices

Choice!chooseCountdown timer!timerGrouped form!formRanking!rankRating!rateText question!ask

Content & media

Data visualization & display!showImage!imageVideo excerpt!video

Flow & composition

Collection!collect / eachDecision?match / ?branchFunctional loop?loopMessage handlerevents / on user.messageReusable flow!use

AI & wording

Candidate suggestionselect ~ / filter ~ / rank ~Closed classification?~Flexible wording~Typed generation!agentWording review!refine

Extension widgets

Extension widget!widget

1 / 20

Next

Questions & choices

Choice

!choose

Offer a single choice or a bounded multiple selection with stable option IDs.

Try it

single-choice.pattern.md
:language 1
choice = !choose {
    What would help right now?
    - pause: "Take a pause"
    - support: "Ask for support"
}
!show {
    You chose {{choice.label}} (ID: {{choice.value}}).
}
-> end
Live result

The interactive example loads as you reach it.

Parameters

Types, requiredness, defaults, and constraints for this component.

ParameterTypeDefaultUse & constraints
bindingRequiredTypeidentifierDefault—The immutable name receiving the confirmed result.
bodyOptionalTypeMarkdownDefaultEmpty bodyAuthored text inside braces; references can read earlier bindings.
optionsConditionalTypeID: "Label" entriesDefault—Static options, or use from instead. IDs must be unique and labels quoted.
fromConditionalTypechoices or list[choice]DefaultStatic optionsAn existing catalogue or list. Cannot be combined with static options.
multiOptionalTypeflagDefaultSingle choiceReturn multiple choices rather than exactly one.
minOptionalTypenonnegative integerDefault1 for multiMinimum confirmed selections. Zero permits an explicitly empty list.
maxOptionalTypenonnegative integerDefaultOffered countMaximum confirmed selections. Static bounds must fit the catalogue; dynamic maxima are capped to it.
preferOptionalTyperadio | chips | checklistDefaultSingle: radio; multi: checklistRadio/chips for single choice; checklist/chips for multi. Presentation does not alter validation.

Returned value

choice or list[choice]

A single choice has .value (ID) and .label (wording). Multi-selection returns catalogue order, rather than click order.

Usage notes

  • Do not mix from with literal options. IDs must be unique; labels may repeat.
  • Legacy :option, :from, :multi, :min, and :max attributes remain accepted. Configured selections are bounded to 1,000 items.
Read the language guide
patternverse
contribute
legal notice privacy safety & use