Skip to content

Chip ​

A single selectable pill — the quality-option look from the design. Text stays full-white in both states; selection shows through the block fill alone. Group several chips under one value for a radio-like row.

Examples ​

Quality row ​

moonbit
@sumi.chip("M", selected=size == "m",
  on_click=set_size(_ => "m"))
@sumi.chip("8K", disabled=true)

API ​

chip ​

NameTypeDefaultDescription
labelString—
selectedBoolfalseFilled on-state (controlled)
on_clickCmd—Click command (wire to your state)
disabledBoolfalseFaded and inert
aria_labelString—
idString—Element id
classString—Extra class names
attrsAttrs—Extra HTML attributes
styleArray[String][]Extra inline styles

* required (labelled) parameter — everything else is optional.