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
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
| Variant | What it is |
|---|---|
| default | 160px label column. |
| compact | 120px 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
| Prop | Type | Default | Description |
|---|---|---|---|
items * | ReadonlyArray<DescriptionItem> | — | Array of [label, value] pairs. Required |
compact | boolean | false | Narrower 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>
| Kind | Name | Description |
|---|---|---|
| property / JSON attribute | items | Array of [label, value] pairs. Required |
| attribute | compact | Narrower label column (120px instead of 160px); default false |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus |