VitalSign
ComplexClinical
<co-vital-sign>VitalSign is one vital tile: label, value, unit, High or Low flag (critical shaded), trend sparkline and time taken.
import { VitalSign } from 'health-components';
Examples
Flags
Critical
Normal
Usage
<VitalSign label="Blood pressure" value="152/94" unit="mmHg" flag="H" trend={[132, 138, 145, 152]} taken="10:12 AM" />
When to use
- Vitals panels and rooming.
When not to use
- Lab values: LabResultTable.
Variants and states
| Variant | What it is |
|---|---|
| normal | Plain. |
| H / L | Badge with arrow and word. |
| HH / LL | Critical: shaded tile. |
| trend | Sparkline. |
Accessibility
- Flag has a word and arrow, not only colour.
Do and don't
- Do: Units always shown.
- Don't: Colour-only flags.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label * | string | — | Vital name ("Blood pressure"); required |
value * | string | number | — | Reading ("152/94"); required |
unit | string | none | Unit ("mmHg") |
flag | ResultFlag | none | 'H' | 'L' | 'HH' | 'LL'; critical flags shade the tile |
trend | number[] | none | number[]: earlier readings, oldest first, drawn as a sparkline |
taken | string | none | Time taken or a note ("10:12 AM", "52nd percentile") |
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-vital-sign>. 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-vital-sign label="…" unit="…" [value]="value"></co-vital-sign>
| Kind | Name | Description |
|---|---|---|
| attribute | label | Vital name ("Blood pressure"); required |
| property / JSON attribute | value | Reading ("152/94"); required |
| attribute | unit | Unit ("mmHg"); default none |
| attribute | flag | 'H' | 'L' | 'HH' | 'LL'; critical flags shade the tile; default none |
| property / JSON attribute | trend | number[]: earlier readings, oldest first, drawn as a sparkline; default none |
| attribute | taken | Time taken or a note ("10:12 AM", "52nd percentile"); default none |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus |