Descriptions

Read-only labeled key/value list. inline for label-left / value-right, bordered for a card.

Installation

import { WrDescriptions, WrDescriptionItem } from 'ngwr/descriptions';

@Component({ imports: [WrDescriptions, WrDescriptionItem] })
export class MyComponent {}

Inline + bordered

<wr-descriptions title="Account" inline bordered>
  <wr-description-item label="Name">Ada Lovelace</wr-description-item>
  <wr-description-item label="Email">[email protected]</wr-description-item>
  <wr-description-item label="Joined">2024-03-12</wr-description-item>
</wr-descriptions>
Account
Name
Ada Lovelace
Email
Joined
2024-03-12

Narrow container (container query)

With responsive, inline layouts query their own width, not the viewport — so the same inline bordered descriptions reflows to a stacked layout when placed in a narrow container, even on a wide page. The box below is fixed at 280px.

Account
Name
Ada Lovelace
Email
Joined
2024-03-12
<div style="width: 280px"><wr-descriptions responsive inline bordered>…</wr-descriptions></div>

Descriptions API

NameDescriptionTypeDefault
titleOptional title shown above the list.string''
inlineTwo-column rows (label left, value right) instead of stacked.booleanfalse
borderedAdd visible borders around each row.booleanfalse
responsiveReflow inline rows back to a stacked layout when the box itself is narrow (a container query on its own width, not the viewport — so it adapts inside a narrow card or side panel). Makes the box fill its container's width.booleanfalse

Description item API

NameDescriptionTypeDefault
labelstring''