Overflow Menu

Material Design 3-styled overflow menu web component (lit-material-overflow-menu) — a responsive action row that collapses overflowing items into a kebab menu.

  • 2.0 KB gzipped
  • @lit-material/overflow-menu 0.0.3
  • Renders on the server

Example

Install

npm install @lit-material/overflow-menu @lit-material/tokens
import "@lit-material/overflow-menu";

Link @lit-material/tokens/css/index.css once per page for the colour, type and shape tokens. Install guide

API

<lit-material-overflow-menu>

A responsive action row: slotted items render inline until they no longer fit the available width, at which point the excess collapses into a "more" (⋮) kebab menu — a native Popover API (popover="auto") dropdown, positioned the same way lit-material-menu positions itself.

Properties

PropertyAttributeTypeDefaultDescription
labellabelstring"More actions"Accessible name for the "more" button.

Events

EventDescription
overflow-changeFires when items move into or out of the overflow menu, with detail.overflowing (the count).

Slots

SlotDescription
defaultThe action items (buttons, links, icon-buttons — any content), in priority order (first = most important, kept visible longest).

CSS parts

PartDescription
rowThe visible row of items.
moreThe "more" (⋮) button. Hidden entirely when nothing overflows.
menuThe overflow popover.

Source on GitHub npm