actionButtons is an array you assign on the element. Each entry is select-all, clear-all, or custom — the built-ins wire their own behaviour, while custom buttons run your onClick(ms).

AB01 Built-in + custom actions

Select all and Clear come wired; a custom button selects the first three.

Controls
Quick usage
 
  • Built-ins auto-disable smartly: Select all disables once every option is selected, Clear disables while nothing is selected — no callback needed.
  • The action bar is laid out with attributes: actions-position, actions-align and actions-layout (try the controls).
  • Custom buttons receive the live element as ms; here ms.setSelected(values, { notify: true }) fires change.

AB02 Dynamic buttons

Text, visibility and disabled state driven by callbacks that re-evaluate on every selection change.

Open the dropdown and select items: the Clear button appears with a live count, and Select all disables once everything is picked.

Quick usage
 
  • getTextCallback(ms) — compute the label (here a live selected count).
  • getIsVisibleCallback(ms) — show/hide the button (Clear only appears when something is selected).
  • getIsDisabledCallback(ms) — enable/disable reactively (Select all off at max).
  • getClassCallback(ms) — swap CSS classes by state (inject the styles via customStylesCallback, since the button lives in the shadow root).
  • Callbacks always win over the matching static property (text, cssClass, …).
Dynamic actionButtons