Design / Design system foundations
Design System Foundations¶
The visual tokens and component rules of the hospital design system: colour, type, spacing, sizing per form factor, focus, motion, clinical value formatting, and print. Every workspace takes its look from here and from nowhere else. The page carries out the clinical UX safety rules (CUX-01 to CUX-67) and the application shell. Where this page and the rulebook disagree, the rulebook wins and this page is corrected.
Status. Design baseline of 17 November 2026, approved by the Enterprise Architecture Board and, for the status colours, by clinical governance on the same day. It replaces the earlier style reference, which was copied from a SaaS marketing site and had no clinical status colours, used purple and green as decoration (against CUX-14), and had no sizes for touch, handheld or wall use. The token values below were checked against WCAG 2.2 AA. Owned by the shell and design-system team (Shell 11, decision 1). Changes to the status colours are governed clinical content (CUX-58).
Component base. React with TypeScript, shadcn components over React Aria (Shell 11, decision 7). React Aria provides the keyboard, focus and screen-reader behaviour. The shadcn layer is restyled with the tokens on this page. No component keeps its library default colours.
- 1. Principles
- 2. Colour
- 3. Typography
- 4. Spacing, density and target size
- 5. Shape, elevation, focus and motion
- 6. Components
- 7. Clinical values, numbers, dates and times
- 8. Print, labels and wristbands
- 9. Tokens (CSS)
- 10. Checks before a design is accepted
1. Principles¶
- Neutral frame, colour for meaning. The shell and content are neutral grey and white. Colour appears only where it carries a status from the colour table of UX rules 3. There is no brand accent colour inside the workforce application.
- Never colour alone. Every status has a colour, a symbol and a word (CUX-14, CUX-17). The design must work in greyscale.
- Density by role, not by taste. Three density modes (section 4) are tied to the form factor of the role (User roles 1).
- Borders, not shadows. Containers are separated by 1 px borders and spacing. Elevation is used only for things that float over content: menus, dialogs and alerts.
- The same part everywhere. A shared component (patient context zone, state label, alert, banner, freshness indicator) has one look in every workspace (CUX-57).
2. Colour¶
Neutrals¶
| Token | Value | Use | Contrast on white |
|---|---|---|---|
--color-surface |
#FFFFFF |
Content background, cards, dialogs | n/a |
--color-surface-alt |
#F9FAFB |
Page background behind cards, table header rows, the status line | n/a |
--color-surface-sunken |
#F2F4F7 |
Read-only fields, disabled controls, grouped panels | n/a |
--color-border |
#EAECF0 |
Decorative dividers and card edges (not the only edge of a control) | n/a |
--color-border-control |
#667085 |
Edges of inputs, checkboxes, radio buttons and outlined buttons (WCAG 1.4.11 needs 3:1) | 4.97:1 |
--color-text |
#101828 |
Body text, headings, values | 17.75:1 |
--color-text-secondary |
#344054 |
Labels, secondary text | 10.46:1 |
--color-text-muted |
#475467 |
Helper text, timestamps, metadata | 7.69:1 |
--color-text-placeholder |
#667085 |
Placeholder text. Placeholders are never the only label | 4.97:1 |
--color-action |
#1D2939 |
Fill of the primary action button, with white text | 14.70:1 |
The primary action is dark neutral, not blue, because blue means "information" (CUX-14). Disabled controls use --color-surface-sunken with --color-text-muted text, and always say why they are disabled where the shell requires it (Shell 7).
Status colours¶
One set per meaning in the colour table of UX rules 3. Each has a foreground (text and icon), a background (tint for badges, rows and banners), a border and, where needed, a solid fill. The foreground passes 4.5:1 on both white and its own background.
| Meaning | Foreground | Background | Border | Solid (with white text) | Symbol |
|---|---|---|---|---|---|
| Danger (red) | #B42318 (6.57:1) |
#FEF3F2 (6.05:1 with fg) |
#F04438 |
#B42318 (6.57:1) |
Octagon, "!!" |
| Caution (amber) | #93370D text, #B54708 icon (5.43:1) |
#FFFAEB (7.21:1 with fg) |
#F79009 |
#FDB022 with dark text #101828 (9.64:1) |
Triangle; clock for stale and overdue |
| Information (blue) | #175CD3 (5.99:1) |
#EFF8FF (5.57:1 with fg) |
#53B1FD |
#175CD3 |
"i" in a circle |
| Completed (green) | #067647 |
#ECFDF3 (5.40:1 with fg) |
#47CD89 |
#067647 |
Tick |
| Inactive (grey) | #475467 |
#F2F4F7 (6.98:1 with fg) |
#98A2B3 |
n/a | None, or strike-through |
| Special access (purple) | #5925DC |
#F4F3FF (7.02:1 with fg) |
#9B8AFB |
#5925DC (7.71:1) |
Shield |
| Training (striped band) | #101828 text |
Diagonal stripes of #FDB022 and #101828, 12 px |
n/a | n/a | "TRAINING" text |
Rules:
- Red and green have almost the same luminance (1.16:1). They are therefore never the only difference between two states. The symbol and word carry the difference (CUX-17).
- Validation errors are amber, with a triangle and text naming the field and the fix (CUX-15, Shell 8). Red is never used for form validation.
- Selection and focus are blue. That is consistent with "information; can be acted on". A selected row uses
--status-info-bgand a 2 px left edge in--status-info-fg. - No other hue is allowed in the workforce application, apart from the triage badge below and data series in charts (section 6).
Triage badge (the one exception, CUX-14)¶
The colours of the hospital's adopted triage scale are configuration, not tokens. The badge has its own shape (a rounded square, 24 px at standard density), always shows the category number and name in text, and the colours appear nowhere else. Placeholder: five levels. Text on each colour must meet 4.5:1; where a scale colour fails that, the badge uses a dark or white text and a 2 px border so it still passes.
Charts¶
Data series in charts and dashboards use the neutral series palette below, not the status colours, so that a line on a chart is never read as a status. A series that crosses a threshold marks the point with the status symbol and colour.
| Series | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| Colour | #1D2939 |
#2E90FA dashed |
#667085 |
#0E9384 |
#7A5AF8 dotted |
#98A2B3 |
Each series also differs by line style or marker shape. Purple in a chart is always dotted and never filled, so it is not read as special access.
Not in release 1¶
A dim mode for wards and theatres at night is a known need. It is not designed in release 1. When it is, it is a full second token set with the same contrast checks, not an inverted palette.
3. Typography¶
Family. Inter, with Noto Sans as the fallback for any character Inter lacks. Both cover the Latin characters of Bahasa Indonesia and English. A single family is used for every size. Inter is set with tabular figures (font-variant-numeric: tabular-nums) in every table, value, identifier and time, so digits line up and do not shift when values change. Inter is under the SIL Open Font License and is served from the hospital's own servers, not a third-party font service (PRS 8.3).
Identifiers. Record numbers, encounter numbers and barcode text use Inter with tabular figures and a slashed zero (font-feature-settings: "zero"), so 0 and O cannot be confused. No monospace font is needed.
Scale. The base size depends on density (section 4). Sizes are in rem so that text scales to 200 percent (WCAG 1.4.4).
| Role | Compact | Standard | Touch and theatre | Wall display | Weight | Line height |
|---|---|---|---|---|---|---|
| Micro label (badge text, column header) | 12 px | 12 px | 14 px | 20 px | 600 | 1.33 |
| Body and table cell | 14 px | 16 px | 18 px | 28 px | 400 | 1.5 |
| Field label | 14 px | 14 px | 16 px | n/a | 500 | 1.43 |
| Patient name in the context zone | 18 px | 20 px | 22 px | 32 px | 600 | 1.3 |
| View title | 20 px | 24 px | 24 px | 36 px | 600 | 1.33 |
| Clinical value in a summary tile | 20 px | 24 px | 28 px | 40 px | 600 | 1.2 |
Rules: nothing under 12 px. Never all capitals for more than two words, except the "TRAINING" band. Italic is not used for meaning. Bold is for the patient name, view title, values and labels only, not for whole paragraphs.
4. Spacing, density and target size¶
Spacing scale. Base unit 4 px: 4, 8, 12, 16, 20, 24, 32, 40, 48, 64.
Density modes.
| Mode | Used by (form factor) | Table row height | Control height | Minimum target | Gap between targets |
|---|---|---|---|---|---|
| Compact | Workstation, high-density roles (User roles 1); reading station | 32 px | 32 px | 24 × 24 px (WCAG 2.5.8) | 8 px |
| Standard | Workstation, medium and low density; counter workstation; patient portal | 40 px | 40 px | 32 × 32 px; 44 × 44 px in the portal | 8 px |
| Touch | Workstation on wheels, handheld, theatre workstation | 56 px | 48 px | 48 × 48 px, for use with gloves | 12 px |
| Wall | Wall display | 64 px | n/a (no input) | n/a | n/a |
Rules:
- A user may switch a workstation from compact to standard. Touch is fixed by the device profile and cannot be turned off.
- Destructive and confirming actions are never adjacent without a 16 px gap or a separator (CUX-11, CUX-12).
- The patient context zone has a fixed height per mode, so content does not move when flags change (Shell 4).
- Layout widths: the workstation is designed for 1366 to 1920 px. The content area is fluid, with no maximum width, because worklists need the space. Text in reading views (notes, letters, policy text) is limited to about 80 characters per line. The handheld is designed for 360 to 430 px wide, in portrait.
5. Shape, elevation, focus and motion¶
Radius. 4 px for inputs, buttons and badges; 8 px for cards, panels and dialogs; full (9999 px) only for counters and avatars. Status badges are not pills, so the triage badge's shape stays distinct.
Elevation.
| Level | Shadow | Use |
|---|---|---|
| 0 | none, 1 px --color-border |
Cards, panels, tables |
| 1 | 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.10) |
Menus, popovers, the encounter switcher |
| 2 | 0 12px 16px -4px rgba(16,24,40,.08), 0 4px 6px -2px rgba(16,24,40,.03) |
Dialogs and alerts |
A dialog backdrop dims the content area only. It never covers the global bar, the patient context zone or the system banner (Shell 2).
Focus. Every focusable element shows a 2 px outline in #175CD3 with a 2 px offset, plus a 4 px white inner ring so it shows on any background (WCAG 2.4.7, 2.4.11 and 2.4.13). The focus outline is never removed. Focus never moves on its own except into a dialog that opens, and back to the trigger when it closes.
Motion. Transitions last at most 150 ms and only change opacity or position. Nothing flashes more than three times a second (WCAG 2.3.1). Alerts do not flash; a high-priority alert may pulse its border once on arrival. With prefers-reduced-motion, all motion is removed. Wall display pages change with a cut, not an animation.
6. Components¶
These are the shared components of CUX-57. Workspaces use them and do not restyle them.
| Component | Anatomy and tokens |
|---|---|
| Patient context zone | --color-surface with a 1 px bottom border --color-border-control. Line 1: title in muted text, then the name in patient-name size, weight 600; identifier label and value with tabular figures; date of birth and age; sex; identity status badge. Line 2: encounter, location, team; allergy status (red badge with octagon for documented allergies; amber "Not assessed" or "Not reviewed"). Line 3: flags as badges. Contents and order: Shell 4 |
| Item header | Same frame as the patient context zone, for a governed item: identifier, version, state label (Shell 3) |
| State label | Badge, 4 px radius, the state's colour, symbol and the exact label from the glossary. Draft: grey outline, dashed border. Saved: grey. Signed: green tick. Released: blue. Cancelled and Entered in error: grey with strike-through of the content, not of the label |
| Status badge | Background tint, foreground text and icon, 1 px border of the same status. Text is never omitted, even in a dense table |
| Abnormal and critical value | Abnormal: value in --color-text, followed by "↑ H" or "↓ L" in amber foreground. Critical: "!! Critical" badge in danger colours beside the value. A normal value has no colour (CUX-16) |
| Alert, tier 1 and 2 | Dialog at elevation 2, 4 px top edge and header band in danger colours with the octagon. Title states what was detected. Buttons: the safe action is primary; override is secondary and needs a reason first (CUX-21 to CUX-25). Tier 1 on bedside devices: full-screen danger background, octagon at 96 px, the word "STOP" and what to do |
| Alert, tier 3 | Inline message under the field or item: caution colours when it is a risk, information colours when it is advice (CUX-20 table) |
| Alert, tier 4 | Row in the side panel or task list, information colours |
| System banner | Full width above the global bar, 40 px. Downtime of a Tier 1 clinical function: solid danger with white text. Degraded service and read-only: caution background. Training: striped band. Never dismissable (Shell 7) |
| Freshness indicator | "As at hh:mm" in muted text. Stale: caution colours, clock symbol, "Not updated for n minutes", or hours or days for daily and period data (CUX-53) |
| Old value marker | Caution clock symbol, "Old", and the date, beside the value (CUX-50) |
| Provenance label | Outline badge in grey with the label text: Historical, External: [source], Patient-reported, Unverified, Preliminary, AI-drafted (CUX-54) |
| Commit-state indicator | Text and icon. Release 1, online only (PH-11): "Saving" (grey, spinner), "Checking whether this was saved" (caution, clock), "Committed" (green tick, only after server confirmation), "Not saved · try again" (danger), and the stop "Not connected · nothing has been recorded" (danger). Later release with offline: "Recorded on device" (grey), "Waiting to sync" (caution, clock), "Committed", "Conflict" (danger) (CUX-40) |
| Sensitive label | Purple outline badge with shield and "Sensitive" (CUX-42) |
| Restricted row | Fixed-height row in --color-surface-sunken with a grey shield and "Restricted information not shown". Nothing else (CUX-41, PH-02) |
| Break-the-Glass flag | Solid purple badge with white text: shield, "Emergency access", time remaining. In the context zone and the global bar (CUX-44) |
| Earlier access check indicator | Caution background with clock symbol and "Access from earlier check · hh:mm", in the view header and the status line, while a view is open on an earlier decision during a policy outage. Not dismissable. Not purple, so it is never read as emergency access (Shell 7, CUX-67; added 17 Nov 2026) |
| File upload | Secondary "Add file" button with a drop area (1 px dashed --color-border-control); the allowed formats and limit as muted hint text below it. One row per file: file symbol, name, format and size, and a status: "Checking file" (grey, spinner), "File checked" (green tick), or the refusal message in danger text under the row with "Remove". Rules and messages: Shell 13 (added 17 Nov 2026) |
| Buttons | Primary: --color-action fill, white text, one per action bar, rightmost. Secondary: white with --color-border-control edge. Destructive (Cancel order, Discard draft, Mark entered in error): white with danger-coloured text and edge, separated from the primary. Labels name the effect (CUX-10) |
| Inputs | 1 px --color-border-control, 4 px radius, label above the field (never placeholder only). Required fields carry the word "Required" in the label, not a red asterisk (CUX-15). Error: 2 px caution border and the message below |
| Toast | Bottom of the content area, neutral dark background, confirms the user's own action only, closes after 5 seconds, never carries clinical content (CUX-29) |
| Tables | Header row in --color-surface-alt, 600 weight micro labels; 1 px row borders; tabular figures; numbers right-aligned with units in their own column or after the value; sortable columns show the sort direction by symbol |
7. Clinical values, numbers, dates and times¶
These rules are design decisions that put CUX-19 and CUX-59 to CUX-62 into the components. They follow the ISMP list of error-prone abbreviations, symbols and dose designations.
| Rule | How it is shown |
|---|---|
| Decimal separator | Follows the display language: comma in Bahasa Indonesia ("2,5 mg"), point in English ("2.5 mg"). The stored value never changes (NFR-012). Only one locale is used in a session |
| No thousands separator in doses or clinical values | "10000 units" is written without separator, or as "10 000 units" with a thin space. A dot or comma is never used to group thousands in a dose, rate or result, because "1.000" means one thousand in Bahasa Indonesia and one in English. Large doses may use words: "1 million units". Money keeps the locale grouping ("Rp 1.250.000") |
| Aggregate counts and percentages | Counts in reports and dashboards have no separator up to 9999 and a thin space above ("12 500 visits"), as for stock quantities (UX-FIN-005). Percentages have one decimal, with the decimal separator of the display language ("87,5%" in Bahasa Indonesia, "87.5%" in English). Money keeps the locale grouping ("Rp 1.250.000") |
| Leading zero | Always: "0,5 mg", never ",5 mg" |
| No trailing zero | "5 mg", never "5,0 mg", except where the precision of a laboratory result is part of its meaning, as set by the performing laboratory |
| Units | Always shown, from the UCUM-based display set. "unit" or "units" written in full, never "U" or "IU". "mcg", never "µg". Space between number and unit |
| Look-alike drug names | Tall Man lettering for the pairs on the hospital's look-alike, sound-alike list (the LASA list required by Indonesian pharmacy standards), for example "predniSONE" and "prednisoLONE". The list is configuration owned by pharmacy |
| Dates | Day, month as a word, year: "14-Aug-2026" in English and "14-Agu-2026" in Bahasa Indonesia, using the Indonesian month abbreviations Jan, Feb, Mar, Apr, Mei, Jun, Jul, Agu, Sep, Okt, Nov, Des (CUX-19) |
| Times | 24-hour clock, "14:05", never AM or PM. The time zone (WIB, WITA, WIT) is always shown in the status line, and next to any time from a facility in another zone, or a time that is copied, printed or exported (CUX-62) |
| Durations and ages | Ages: years from 2 years; months and days under 2 years; days and hours under 28 days. Durations: "2 h 15 min" |
| Ranges | "1 to 2 tablets", not "1-2", where the dash could be read as minus |
| Entry | A numeric clinical field shows the value it has understood, with unit, before the user leaves the field ("You entered 2,5 mg"). An entry that cannot be read without doubt, such as one with both a point and a comma, or a separator followed by exactly three digits in a dose field, is refused with an amber message (CUX-60) |
8. Print, labels and wristbands¶
Prints and labels are part of the patient identity design (CUX-01, CUX-46, Shell 4 rule 8, Shell 14).
- Every printed page carries, in the header: patient name, No. RM, date of birth; in the footer: page n of N, printed by, printed at (date, time, zone), facility, and the document state (for example "Signed", "Preliminary"). Training prints carry "TRAINING — NOT A RECORD" across every page.
- Print colour. Prints must be readable in black and white. Status is printed as text and symbol only.
- Type for print. Inter 10 pt body, 12 pt patient name, 8 pt minimum anywhere, including labels.
- Wristband, specimen and medication labels follow the content and layout of Shell 14. Each carries name and No. RM as text and a 2-D barcode (DataMatrix) holding the same identifiers. Neither the barcode nor the text carries diagnosis, sensitive category or NIK.
9. Tokens (CSS)¶
:root {
/* Neutrals */
--color-surface: #ffffff;
--color-surface-alt: #f9fafb;
--color-surface-sunken: #f2f4f7;
--color-border: #eaecf0;
--color-border-control: #667085;
--color-text: #101828;
--color-text-secondary: #344054;
--color-text-muted: #475467;
--color-text-placeholder: #667085;
--color-action: #1d2939;
--color-action-text: #ffffff;
--color-focus: #175cd3;
/* Status: danger (red) */
--status-danger-fg: #b42318;
--status-danger-bg: #fef3f2;
--status-danger-border: #f04438;
--status-danger-solid: #b42318;
/* Status: caution (amber) */
--status-caution-fg: #93370d;
--status-caution-icon: #b54708;
--status-caution-bg: #fffaeb;
--status-caution-border: #f79009;
--status-caution-solid: #fdb022;
/* Status: information (blue) */
--status-info-fg: #175cd3;
--status-info-bg: #eff8ff;
--status-info-border: #53b1fd;
/* Status: completed (green) */
--status-done-fg: #067647;
--status-done-bg: #ecfdf3;
--status-done-border: #47cd89;
/* Status: inactive (grey) */
--status-inactive-fg: #475467;
--status-inactive-bg: #f2f4f7;
--status-inactive-border: #98a2b3;
/* Status: special access (purple) */
--status-special-fg: #5925dc;
--status-special-bg: #f4f3ff;
--status-special-border: #9b8afb;
--status-special-solid: #5925dc;
/* Training band */
--training-stripes: repeating-linear-gradient(135deg, #fdb022 0 12px, #101828 12px 24px);
/* Type */
--font-sans: "Inter", "Noto Sans", system-ui, sans-serif;
--font-numeric: tabular-nums;
/* Spacing */
--space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
--space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
--space-12: 48px; --space-16: 64px;
/* Shape */
--radius-control: 4px;
--radius-container: 8px;
--radius-full: 9999px;
/* Elevation */
--elevation-1: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.10);
--elevation-2: 0 12px 16px -4px rgba(16,24,40,.08), 0 4px 6px -2px rgba(16,24,40,.03);
}
/* Density modes, set on the shell root by the device profile and user choice */
[data-density="compact"] { --text-body: 0.875rem; --row-height: 32px; --control-height: 32px; --target-min: 24px; }
[data-density="standard"] { --text-body: 1rem; --row-height: 40px; --control-height: 40px; --target-min: 32px; }
[data-density="touch"] { --text-body: 1.125rem; --row-height: 56px; --control-height: 48px; --target-min: 48px; }
[data-density="wall"] { --text-body: 1.75rem; --row-height: 64px; }
10. Checks before a design is accepted¶
In addition to the rulebook review of CUX-55:
- Greyscale check: every state still distinguishable.
- Colour-vision check: protanopia, deuteranopia and tritanopia simulation.
- Contrast: text 4.5:1, large text and controls 3:1, using the token values above.
- 200 percent zoom and 320 px reflow on the portal.
- Keyboard only: every action reachable, focus visible, no trap.
- Both languages: Bahasa Indonesia labels are on average longer than English; design with the Indonesian text.
- Longest real values: a 60-character name, a 12-character record number, three allergies, four flags.
- Print preview in black and white.
Related: Clinical UX safety rules · Application shell · Glossary