Skip to content
Elements / Input

segmented

binds state

Two to six short options in one track, one chosen, like Week, Month and Year, or Chart and Table. Show different content for each with if=.

Spec · edit me

No problems. The parser accepted every line.

Result · try itOpen in playground
Tweak the props

Props

bindstateThe state name holding the chosen option's text.required
labelstringWhat the choice is about, read by screen readers, e.g. label="Period". Default: the text just above it.—
optionsstringThe options, comma-separated, e.g. options="Week,Month,Year". At most 6, one or two words each.required
onactionActions to run after the choice changes, e.g. emit:changed. Separate several with ;—
ifconditionShow only when this expression is true, e.g. if=done or if={count>0}. Every element takes it.—
tipstringA short explanation shown on hover, keyboard focus or a tap, e.g. tip="Orders not yet shipped": for a term or a number some people won't know, instead of more words on screen. It makes the element a Tab stop if it isn't one. Every element takes it.—

SayShape v0.1 is an early prototype under the MIT License. Status · GitHub