AB Menu
Structured action/context menu: trigger slot + ab-menu-item children, aggregated ab-select on host.
HTML tag: c-e2d3a6aec620d48eb99ad00a740001631
When to use
Section titled “When to use”- context or action menu with discrete choices
- kebab/overflow menu from a trigger
- not a form select or app sidebar
| Prop | Type | Default | Description |
|---|---|---|---|
open | Boolean | false | |
disabled | Boolean | false | |
placement | String | bottom-start | |
close_on_outside_click | Boolean | true | |
portal | Boolean | true | |
keep_open_on_select | Boolean | false | |
close_on_escape | Boolean | true |
- Put opener in slot=“trigger”; list ab-menu-item (and separators) as light DOM children.
- Listen @ab-select on ab-menu for selection (detail item/value).
- open / openDropdown / closeDropdown control visibility; keep_open_on_select for multi-pick menus.
- Checkbox items also emit change on ab-menu-item.
Events
Section titled “Events”| Event | Detail |
|---|---|
ab-select | item: Element, value: any |
Methods
Section titled “Methods”| Signature | Description |
|---|---|
openDropdown() | |
closeDropdown() | |
close() |
What to avoid
Section titled “What to avoid”Do not use for form option fields (ab-select). Do not use for app sidebar routes (ab-nav). Do not listen only on items if host ab-select is enough.
Example
Section titled “Example”<c-e2d3a6aec620d48eb99ad00a740001631 .open=${open} @ab-select=${onPick}> <c-e1e50e9eb30704a5cbb1fd51ba1afed37 slot="trigger" .label=${'More'}></c-e1e50e9eb30704a5cbb1fd51ba1afed37> <c-efb995cdbade3489f888993928e7b9181 .value=${'edit'} .inner_text=${'Edit'}></c-efb995cdbade3489f888993928e7b9181></c-e2d3a6aec620d48eb99ad00a740001631>