Component

List

Generic list with leading / body / trailing slots. Bordered or flat, with optional dividers + dense padding. Items can be plain or interactive (hover + Enter/Space activation).

Import

import { WrList, WrListItem } from 'ngwr/list';

Playground

    📁 Reports 12📁 Invoices 4📁 Customers 128📁 Settings 🔒 Archived
<wr-list bordered dividers >
  <wr-list-item interactive>
    <span ngProjectAs="[wrListItemLeading]">📁</span>
    Reports
    <span ngProjectAs="[wrListItemTrailing]">12</span>
  </wr-list-item>
</wr-list>

Customize

Bordered
Dividers
Dense
Interactive rows

API

NameDescriptionTypeDefault
<wr-list>Container — renders <ul role="list"> inside.component
borderedWrap in a card-style border + radius.booleanfalse
dividersThin border between consecutive items.booleanfalse
denseCompact vertical padding.booleanfalse
ariaLabelOptional accessible label for the list.string''
<wr-list-item>Row with three projection slots: [wrListItemLeading], default body, [wrListItemTrailing].component
interactiveHover + cursor pointer + Enter/Space activation + listitem role.booleanfalse
disabledVisual disabled + suppresses interaction.booleanfalse
CSS — --wr-list-item-padding-y / -xPer-row padding.length0.625rem / 1rem
CSS — --wr-list-item-gapGap between leading / body / trailing slots.length0.75rem
CSS — --wr-list-divider-colorDivider line colour.colorvar(--wr-color-light)
CSS — --wr-list-hover-bgHover background on interactive rows.colorrgba(light, 0.4)

CSS variables

Custom properties ngwr/list publishes. Each default below is declared on the component's own selector, so a :root override is shadowed by it — set them on that selector, on a wrapper you scope yourself, or inline on the element. Unlike the BEM class names, these are the supported way to restyle the component.

VariableDefaultDeclared on
--wr-list-active-bgrgba(var(--wr-color-primary-rgb), 0.08).wr-list
--wr-list-bgtransparent.wr-list
--wr-list-divider-colorvar(--wr-color-outline).wr-list
--wr-list-hover-bgvar(--wr-color-hover).wr-list
--wr-list-item-gap0.75rem.wr-list
--wr-list-item-padding-x1rem.wr-list
--wr-list-item-padding-y0.625rem.wr-list +1 variant override