Skip to main content

DescriptionList

BasicData display<co-description-list>

DescriptionList shows label and value pairs in two columns, such as Patient, Date of Birth and MRN.

import { DescriptionList } from 'health-components';

Examples​

Compact​

Storybook

Usage​

<DescriptionList items={[["Patient", "Nora Scott"], ["MRN", "MRN-100377"]]} />

When to use​

  • Read-only record details in cards, drawers and confirm dialogs.

When not to use​

  • Editable forms: use fields.

Variants and states​

VariantWhat it is
default160px label column.
compact120px label column.

Accessibility​

  • Native dl, dt, dd.

Do and don't​

  • Do: Show the claim number, payer and amount in a destructive confirm.
  • Don't: Put actions inside the value column.

Props​

PropTypeDefaultDescription
items *ReadonlyArray<DescriptionItem>—Array of [label, value] pairs. Required
compactbooleanfalseNarrower label column (120px instead of 160px)

Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, plus className and event handlers on the root element.

Angular, Vue and HTML​

Register the elements once (Angular guide), then use <co-description-list>. Attributes take strings; arrays and objects are set as properties (Angular [prop], Vue :prop) or as JSON attributes. Callbacks are DOM events with the value in event.detail.

Angular template
<co-description-list compact default-checked [items]="items"></co-description-list>
KindNameDescription
property / JSON attributeitemsArray of [label, value] pairs. Required
attributecompactNarrower label column (120px instead of 160px); default false
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus