import { Component } from '@angular/core';
import { WrList, WrListItem } from 'ngwr/list';
@Component({ imports: [WrList, WrListItem] })
export class MyComponent {}List
A list of rows with leading, body and trailing slots.
Installation
Import the class, and @use the entry point in your global styles: without it the component renders unstyled.
Playground
<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
| Name | Description | Type | Default |
|---|---|---|---|
<wr-list> | Container. Renders <ul role="list">. | component | — |
bordered | Card-style border and radius. | boolean | false |
dividers | Thin border between consecutive items. | boolean | false |
dense | Compact vertical padding. | boolean | false |
ariaLabel | Optional accessible label for the list. | string | '' |
<wr-list-item> | Row with three projection slots: [wrListItemLeading], default body, [wrListItemTrailing]. | component | — |
interactive | Hover state, a tab stop and Enter / Space activation. | boolean | false |
disabled | Dims the row and blocks interaction. | boolean | false |
CSS variables
Set these on the component's selector or a wrapper, not on :root: the defaults are declared on ngwr/list's own element.
| Variable | Default | Declared on |
|---|---|---|
--wr-list-active-bg | color-mix(in srgb, var(--wr-color-primary) 8%, transparent) | .wr-list |
--wr-list-bg | transparent | .wr-list |
--wr-list-divider-color | var(--wr-border-base) | .wr-list |
--wr-list-font-family | var(--wr-font-family-base) | .wr-list |
--wr-list-font-size | var(--wr-text-sm) | .wr-list |
--wr-list-hover-bg | var(--wr-color-hover) | .wr-list |
--wr-list-item-gap | var(--wr-space-md) | .wr-list |
--wr-list-item-padding-x | var(--wr-space-lg) | .wr-list |
--wr-list-item-padding-y | var(--wr-space-md) | .wr-list +1 variant override |
--wr-list-radius | var(--wr-border-radius-base) | .wr-list |
See also
Component Sortable ListA list the user reorders by drag or keyboard.Component Virtual ScrollA long list of same-height rows that renders only the rows on screen.Component AvatarA user's picture, with initials as the fallback.Component TableRows of data with sorting, filtering, paging and custom cells.Component DescriptionsA read-only list of labels and their values.Component PaginationPage navigation for a long list.