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-alignandactions-layout(try the controls). - Custom buttons receive the live element as
ms; herems.setSelected(values, { notify: true })fireschange.
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 viacustomStylesCallback, since the button lives in the shadow root).- Callbacks always win over the matching static property (
text,cssClass, …).
Dynamic actionButtons