List

Material Design 3 list web components (lit-material-list, lit-material-list-item).

  • 2.9 KB gzipped
  • @lit-material/list 0.1.0
  • Renders on the server

Example

Install

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

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

API

<lit-material-list-item>

Material Design 3 list item.

Properties

PropertyAttributeTypeDefaultDescription
interactiveinteractivebooleanfalseMakes the whole row a single clickable/tappable surface. Implied by setting href.
disableddisabledbooleanfalse
selectedselectedbooleanfalseHighlights the row, e.g. for the current selection in a navigation list.
dividerdividerbooleanfalseRenders a hairline divider below the row.
typetypeListItemType"button"
namenamestring""
valuevaluestring""
formformstring | undefinednone
hrefhrefstring""If set, renders the item as a link (<a>) instead of a <button>; implies interactive.
targettargetstring""

Slots

SlotDescription
defaultThe headline text.
overlineOptional small text shown above the headline.
supporting-textOptional text shown below the headline.
leadingOptional leading content (icon, avatar, image, checkbox…). Sized by its own content — not forced to a fixed icon size, since it can be anything from a 24px icon to a 40px avatar.
trailingOptional trailing content (icon, text, switch…), same sizing note as leading.

CSS parts

PartDescription
itemThe <div>, <button>, or <a> row (background/padding).
rippleThe state-layer element the hover/press feedback is drawn on. Only rendered when interactive.
focus-ringThe focus indicator element. Only rendered when interactive.

<lit-material-list>

Material Design 3 list — a surface container for lit-material-list-item children.

Slots

SlotDescription
defaultlit-material-list-item elements (or any other content).

CSS parts

PartDescription
listThe outer container (background, vertical padding).

Source on GitHub npm