Skip to content

Checkbox Menu ​

A multi-select menu panel: grouped rows carrying an outline checkbox that toggle independently, an optional per-group clear action, and a pinned footer row. The body scrolls past the max height.

Examples ​

Grouped multi-select ​

moonbit
@sumi.checkbox_menu(
  groups=[
    @sumi.CheckboxMenuGroup::new([
      @sumi.CheckboxMenuItem::new("text", "Text", checked=true),
      @sumi.CheckboxMenuItem::new("date", "Date"),
    ], title="Fields", clear_label="Clear", on_clear=clear_fields),
  ],
  on_toggle=set_selected.map(v => fn(c) { toggle(c, v) }),
  footer_label="Show all",
  on_footer=show_all,
)

API ​

checkbox_menu ​

NameTypeDefaultDescription
groups *Array[CheckboxMenuGroup]—Titled sections of rows; a hairline sits between groups
on_toggleEmit[String]—Emits the clicked row's value
widthInt200Panel width — the design's steps are 160/200/240/320
max_heightInt480Scroll threshold for the body
footer_labelString—Pinned row below the scroll area
footer_iconHtml—Leading icon of the footer row
on_footerCmd—Footer row activation
idString—Element id
classString—Extra class names
attrsAttrs—Extra HTML attributes
styleArray[String][]Extra inline styles

CheckboxMenuGroup::new ​

One titled section.

NameTypeDefaultDescription
itemsArray[CheckboxMenuItem]—
titleString—Section caption
clear_labelString—Text action at the title's right edge
on_clearCmd—Clear action command

CheckboxMenuItem::new ​

One toggleable row.

NameTypeDefaultDescription
valueString—
labelString—
iconHtml—Leading icon
checkedBoolfalseControlled checked flag
disabledBoolfalseDims and deactivates the row

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