Data List

Material Design 3-styled data list web components (lit-material-data-list, lit-material-data-list-item, lit-material-data-list-cell) — flexible multi-cell rows, optionally expandable.

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

Example

Install

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

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

API

<lit-material-data-list-cell>

One cell within a lit-material-data-list-item row — a flex item. fill grows to take up remaining row width (typically the row's main content cell); cells without it size to their own content (typically an icon or an actions cell).

Properties

PropertyAttributeTypeDefaultDescription
fillfillbooleanfalse

Slots

SlotDescription
defaultThe cell's content.

<lit-material-data-list-item>

One row within lit-material-data-list. The default slot holds this row's lit-material-data-list-cell elements (or any content — cells are a convenience, not a requirement), laid out as a flex row.

Properties

PropertyAttributeTypeDefaultDescription
selectedselectedbooleanfalse
expandableexpandablebooleanfalse
openopenbooleanfalseWhether an expandable row's extra content is showing. Ignored otherwise.

Events

EventDescription
toggleWhen expandable, fires after open changes via user interaction.

Slots

SlotDescription
defaultThe row's content — typically lit-material-data-list-cell elements.
expanded-contentExtra content revealed when expandable and open.

CSS parts

PartDescription
rowThe row (or, when expandable, the <details> itself).
summaryThe <summary>. Only rendered when expandable.
expandedThe expanded-content container. Only rendered when expandable.

<lit-material-data-list>

Groups lit-material-data-list-item rows into a native <ul> — a list of flexible, multi-cell rows, each independently sized via lit-material-data-list-cell's fill, optionally expandable. Distinct from lit-material-data-table, whose rows all share the same fixed columns: a data list's rows can each lay out their own cells differently, and any individual row can expand to reveal extra content without needing a whole extra table column for it.

Slots

SlotDescription
defaultlit-material-data-list-item elements.

CSS parts

PartDescription
listThe <ul>.

Source on GitHub npm