Toolbar

Material Design 3-styled toolbar web components (lit-material-toolbar, lit-material-toolbar-spacer).

  • 754 B gzipped
  • @lit-material/toolbar 0.1.0
  • Renders on the server

Example

Install

npm install @lit-material/toolbar @lit-material/tokens
import "@lit-material/toolbar";

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

API

<lit-material-toolbar-spacer>

A flexible spacer for lit-material-toolbar: place one between two groups of items to push everything after it to the far end of the toolbar. Has no content of its own — it's purely a flex: 1 1 auto sizing hint.

<lit-material-toolbar>

A row of grouped controls — search fields, filter chips, buttons — above a piece of content (a data table, a list). Lays out its slotted children directly as flex items (wrapping by default) rather than wrapping them in its own shadow DOM structure, so any element works as a child without a lit-material-toolbar-item wrapper being required. Pair with lit-material-toolbar-spacer to push trailing items to the far end.

Properties

PropertyAttributeTypeDefaultDescription
densedensebooleanfalseTighter gap/padding, for toolbars nested inside already-dense contexts.

Slots

SlotDescription
defaultToolbar content: buttons, chips, text fields, lit-material-toolbar-spacer, in order.

Source on GitHub npm