Early Warning Score View
EarlyWarningScoreView is a headless read-only display of an early warning score: the scoring system's name, the score, its band and the escalation it calls for. It renders as a <span>. It is display only and computes nothing.
Status: experimental — new, implemented and unit-tested in every headless library; not yet exercised in a composed flow.
Example
NEWS2 7 High Urgent response
Show demo markup
<span class="early-warning-score-view" data-band="high"><span class="early-warning-score-view-system">NEWS2</span> <span class="early-warning-score-view-score">7</span> <span class="early-warning-score-view-band">High</span> <span class="early-warning-score-view-escalation">Urgent response</span></span>
Usage example
<EarlyWarningScoreView
system="NEWS2"
score="{7}"
band="high"
bandLabel="High"
escalation="Urgent response"
/>
Show Svelte source
// In your Svelte component:
import EarlyWarningScoreView from "lily-design-system-svelte-headless/components/EarlyWarningScoreView/EarlyWarningScoreView.svelte";
<EarlyWarningScoreView>
<!-- content -->
</EarlyWarningScoreView>
Usage
<EarlyWarningScoreView
system="NEWS2"
score="{7}"
band="high"
bandLabel="High"
escalation="Urgent response"
/>
Props
score: string | number (required) — the score the consumer computed
system: string (optional) — the scoring system's name, such as NEWS2
band: string (optional) — the consumer's band key, rendered as data-band
bandLabel: string (optional) — the band in words; required with band
escalation: string (optional) — what to do
label: string (optional) — hidden text naming the value
...restProps: any — additional HTML attributes spread onto the root
Keyboard Interactions
None. This is not an interactive component.
ARIA
- No role and no
aria-label; label renders as hidden text. The band is text, never colour alone
When to Use
- Use to show an early warning score your own validated code computed.
- Use on an observations chart, a ward board or a handover summary.
When Not to Use
- Do not expect it to compute a score — it never will.
- Do not use for a laboratory result — use
observation-view.
- Do not use for a general gauge — use
gauge-chart.
Headless
This headless component ships zero CSS and decides nothing visual. The consumer provides all styling targeting the .early-warning-score-view class hook, and every word.
Styles
.early-warning-score-view and its parts, and [data-band].
Testing
- Each part renders, and
band renders as data-band
- A band with no words raises a development warning
- It contains no scoring code (review)
Advice
- Name the scoring system, since bands and escalation differ between them.
- NEWS2 is not for under-16s or pregnancy; use the score your population needs.
Implementation Notes
- Renders
<span class="early-warning-score-view"> with parts -system, -score, -band and -escalation
band is the consumer's key, rendered as data-band; bandLabel is its words and is required with it (a development warning says so)
- Computes nothing: scoring systems differ by country and population, and scoring is the consumer's validated code
Related components
observation-view — a clinical observation or result
gauge-chart — a dial chart showing one value within a range
References
Lily™ and Lily Design System™ are trademarks.
Canonical contract
Generated from this component's canonical metadata — the machine-checked source the implementations are held to.
Metadata
- Component: early-warning-score-view
- PascalCase: EarlyWarningScoreView
- Description: a read-only display of an early warning score, with its band and escalation text
- Status: experimental — new, implemented and unit-tested in every headless library; not yet exercised in a composed flow
- HTML tag: <span>
- CSS class: .early-warning-score-view
- Interactive: no
ARIA
- No role and no
aria-label; label renders as hidden text. The band is text, never colour alone
Keyboard
Props
score: string | number (required) — the score the consumer computed system: string (optional) — the scoring system's name, such as NEWS2 band: string (optional) — the consumer's band key, rendered as data-band bandLabel: string (optional) — the band in words; required with band escalation: string (optional) — what to do label: string (optional) — hidden text naming the value ...restProps: any — additional HTML attributes spread onto the root