Design system components
Every component in turn.healthpass.ds, as its storybook shows it. Each screenshot is the component rendered by the library and styled by the design system's stylesheet, at the 440 px width the patient pages are designed for.
The call under each screenshot is the component's interface, taken from its props declaration: the placeholders are types, not example values. SLOT takes the output of another component, STRING text, ENUM one of the listed values, TABLE a Lua table, BOOLEAN true or false.
Foundations
Foundations: colors

Foundations: fonts

Foundations: icons
![]()
Foundations: illustrations

Cards
Cards: base card

local cards = require("turn.healthpass.ds.components.cards")
cards.base_card({
href = STRING,
icon = SLOT,
label = STRING,
text = STRING,
number = STRING,
details = STRING,
date = STRING,
status = SLOT,
trailing_icon = SLOT,
attrs = TABLE,
download = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
href | string | Absolute link target, e.g. '/apps/<uuid>/vitals'. When set, the whole card is a link. | ||
icon | slot | Leading visual: an icon or a small component (e.g. a date tile). | ||
label | string | Small heading above the values. | ||
text | string | Primary text value. | ||
number | string | Prominent pre-formatted value, e.g. '120/80 mmHG' | ||
details | string | Supporting copy under the values. | ||
date | string | Pre-formatted date line. | ||
status | slot | Trailing status, e.g. a badge. | ||
trailing_icon | slot | Right-aligned affordance icon (chevron, check, eye). | ||
attrs | table | Pass-through attributes on the card link, restricted to data-, hx- and aria-*. | ||
download | string | Download filename; renders the link's download attribute. Requires href. |
Cards: text card

local cards = require("turn.healthpass.ds.components.cards")
cards.text_card({
icon = SLOT,
text = STRING,
details = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
icon | slot | Leading icon. | ||
text | string | Card heading, e.g. 'What you reported'. | ||
details | string | Body copy. |
Cards: vitals card

local cards = require("turn.healthpass.ds.components.cards")
cards.vitals_card({
label = STRING,
number = STRING,
date = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
label | string | Reading name, e.g. 'Blood pressure'. | ||
number | string | Pre-formatted reading, e.g. '120/80 mmHG'. | ||
date | string | Pre-formatted date line. |
Cards: prescription card

local cards = require("turn.healthpass.ds.components.cards")
cards.prescription_card({
text = STRING,
details = STRING,
date = STRING,
href = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | Card heading, e.g. 'Prescription'. | ||
details | string | Supporting copy. | ||
date | string | Pre-formatted date line. | ||
href | string | Link target; when set the card is a link and shows the chevron affordance. |
Cards: sicknote card

local cards = require("turn.healthpass.ds.components.cards")
cards.sicknote_card({
text = STRING,
details = STRING,
date = STRING,
href = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | Card heading, e.g. 'Sick note'. | ||
details | string | Supporting copy. | ||
date | string | Pre-formatted date line. | ||
href | string | Link target; when set the card is a link and shows the chevron affordance. |
Cards: labresults card

local cards = require("turn.healthpass.ds.components.cards")
cards.labresults_card({
text = STRING,
details = STRING,
date = STRING,
href = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | Card heading, e.g. 'Lab results'. | ||
details | string | Supporting copy. | ||
date | string | Pre-formatted date line. | ||
href | string | Link target; when set the card is a link and shows the chevron affordance. |
Cards: referral card

local cards = require("turn.healthpass.ds.components.cards")
cards.referral_card({
text = STRING,
details = STRING,
date = STRING,
href = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | Card heading, e.g. 'Referral'. | ||
details | string | Supporting copy. | ||
date | string | Pre-formatted date line. | ||
href | string | Link target; when set the card is a link and shows the chevron affordance. |
Cards: visitsummary card

local cards = require("turn.healthpass.ds.components.cards")
cards.visitsummary_card({
text = STRING,
details = STRING,
date = STRING,
href = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | Card heading, e.g. 'Visit summary'. | ||
details | string | Supporting copy. | ||
date | string | Pre-formatted date line. | ||
href | string | Link target; when set the card is a link and shows the chevron affordance. |
Cards: visit card

local cards = require("turn.healthpass.ds.components.cards")
cards.visit_card({
date = DATE,
text = STRING,
details = STRING,
href = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
date | date | yes | Visit date for the calendar tile. | |
text | string | Specialty, e.g. 'Otorhinolaryngology'. | ||
details | string | Provider, e.g. 'Maria Silva at Turn Health'. | ||
href | string | Link target; when set the card is a link and shows the chevron affordance. |
Cards: consult card

local cards = require("turn.healthpass.ds.components.cards")
cards.consult_card({
text = STRING,
details = STRING,
date = DATE,
href = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | Consult summary | Card heading. | |
details | string | Clinician line, e.g. 'With Ayanda Mokoena'. | ||
date | date | yes | When the consult was; renders as '15 Jul 2026, 9:30'. | |
href | string | Link target; when set the card is a link and shows the chevron affordance. |
Cards: about card
local cards = require("turn.healthpass.ds.components.cards")
cards.about_card({
label = STRING,
text = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
label | string | Field name, e.g. 'Name'. | ||
text | string | Field value, e.g. 'Sashi Hlophe'. |
Cards: medication card

local cards = require("turn.healthpass.ds.components.cards")
cards.medication_card({
text = STRING,
details = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | Medication, e.g. 'Amoxicilin 500MG Oral tablet'. | ||
details | string | Dosing, e.g. '2 times daily'. |
Cards: vaccination card
local cards = require("turn.healthpass.ds.components.cards")
cards.vaccination_card({
text = STRING,
date = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | Vaccine, e.g. 'COVID-19'. | ||
date | string | Pre-formatted date line. |
Cards: vitals detail card

local cards = require("turn.healthpass.ds.components.cards")
cards.vitals_detail_card({
number = STRING,
date = STRING,
status = SLOT,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
number | string | Pre-formatted reading, e.g. '120/80 mmHG'. | ||
date | string | Pre-formatted date line. | ||
status | slot | Status badge, e.g. badges.badge output. |
Cards: lab test result card
local cards = require("turn.healthpass.ds.components.cards")
cards.lab_test_result_card({
label = STRING,
number = STRING,
status = SLOT,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
label | string | Measure name, e.g. 'Hematocrit'. | ||
number | string | Pre-formatted value, e.g. '34%'. | ||
status | slot | Status badge, e.g. badges.badge output. |
Cards: lab test card

local cards = require("turn.healthpass.ds.components.cards")
cards.lab_test_card({
text = STRING,
status = SLOT,
href = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | Test name, e.g. 'CBC Panel - Blood by automated count'. | ||
status | slot | Status badge, e.g. badges.badge output. | ||
href | string | Link target; when set the card is a link and shows the chevron affordance. |
Cards: allergy card

local cards = require("turn.healthpass.ds.components.cards")
cards.allergy_card({
text = STRING,
details = STRING,
status = SLOT,
href = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | Allergen, e.g. 'Penicilin'. | ||
details | string | Category, e.g. 'Medication'. | ||
status | slot | Status badge, e.g. badges.badge output. | ||
href | string | Link target; when set the card is a link and shows the chevron affordance. |
Cards: menu item card

local cards = require("turn.healthpass.ds.components.cards")
cards.menu_item_card({
icon = SLOT,
text = STRING,
count = NUMBER,
trailing_icon = ENUM,
href = STRING,
attrs = TABLE,
download = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
icon | slot | Leading illustration. | ||
text | string | yes | Menu label, e.g. 'Test Results'. | |
count | number | 0 | Optional tally shown in a green circle; hidden when 0. | |
trailing_icon | enum, one of 23 names (see Foundations) | Trailing icon, e.g. 'eye'. Defaults to a chevron when href is set. | ||
href | string | Link target; when set the card is a link and shows the chevron affordance. | ||
attrs | table | Pass-through attributes on the card link, restricted to data-, hx- and aria-*. | ||
download | string | Download filename; renders the link's download attribute. Requires href. |
Cards: selection list card

local cards = require("turn.healthpass.ds.components.cards")
cards.selection_list_card({
text = STRING,
selected = BOOLEAN,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | Row label, e.g. a family member's name. | ||
selected | boolean | false | Whether the row shows the selected check. |
Richtext
Richtext: elements

local richtext = require("turn.healthpass.ds.components.richtext")
richtext.body({
content = SLOT,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
content | slot | yes | The HTML rich text snippet |
Section
Section: section

local section = require("turn.healthpass.ds.components.section")
section.section({
title = STRING,
color = ENUM,
variant = ENUM,
content = SLOT,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
title | string | Optional heading above the panel, e.g. 'Visit Summary'. | ||
color | enum, one of purple, green, blue, gray, orange, yellow, red | gray | Heading color. | |
variant | enum, one of cards, text | cards | What the panel holds: a stack of cards, or a block of copy. | |
content | slot | yes | The panel's content: ds cards, or a ds.richtext body. |
Section: text

local section = require("turn.healthpass.ds.components.section")
section.section({
title = STRING,
color = ENUM,
variant = ENUM,
content = SLOT,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
title | string | Optional heading above the panel, e.g. 'Visit Summary'. | ||
color | enum, one of purple, green, blue, gray, orange, yellow, red | gray | Heading color. | |
variant | enum, one of cards, text | cards | What the panel holds: a stack of cards, or a block of copy. | |
content | slot | yes | The panel's content: ds cards, or a ds.richtext body. |
Section: colors

local section = require("turn.healthpass.ds.components.section")
section.section({
title = STRING,
color = ENUM,
variant = ENUM,
content = SLOT,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
title | string | Optional heading above the panel, e.g. 'Visit Summary'. | ||
color | enum, one of purple, green, blue, gray, orange, yellow, red | gray | Heading color. | |
variant | enum, one of cards, text | cards | What the panel holds: a stack of cards, or a block of copy. | |
content | slot | yes | The panel's content: ds cards, or a ds.richtext body. |
Header
Header: header

local header = require("turn.healthpass.ds.components.header")
header.header({
color = ENUM,
back = STRING,
action = SLOT,
title = STRING,
text = STRING,
date = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
color | enum, one of purple, green, blue, gray, orange, white, yellow, red | gray | The color of the header | |
back | string | Absolute link target, e.g. '/apps/<uuid>/vitals'. When set, the whole card is a link. | ||
action | slot | Action or illustration in the top right corner | ||
title | string | Page title | ||
text | string | Optional text. | ||
date | string | Optional pre-formatted date line. |
Header: header with date

local header = require("turn.healthpass.ds.components.header")
header.header({
color = ENUM,
back = STRING,
action = SLOT,
title = STRING,
text = STRING,
date = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
color | enum, one of purple, green, blue, gray, orange, white, yellow, red | gray | The color of the header | |
back | string | Absolute link target, e.g. '/apps/<uuid>/vitals'. When set, the whole card is a link. | ||
action | slot | Action or illustration in the top right corner | ||
title | string | Page title | ||
text | string | Optional text. | ||
date | string | Optional pre-formatted date line. |
Header: header with action

local header = require("turn.healthpass.ds.components.header")
header.header({
color = ENUM,
back = STRING,
action = SLOT,
title = STRING,
text = STRING,
date = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
color | enum, one of purple, green, blue, gray, orange, white, yellow, red | gray | The color of the header | |
back | string | Absolute link target, e.g. '/apps/<uuid>/vitals'. When set, the whole card is a link. | ||
action | slot | Action or illustration in the top right corner | ||
title | string | Page title | ||
text | string | Optional text. | ||
date | string | Optional pre-formatted date line. |
Header: header long content

local header = require("turn.healthpass.ds.components.header")
header.header({
color = ENUM,
back = STRING,
action = SLOT,
title = STRING,
text = STRING,
date = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
color | enum, one of purple, green, blue, gray, orange, white, yellow, red | gray | The color of the header | |
back | string | Absolute link target, e.g. '/apps/<uuid>/vitals'. When set, the whole card is a link. | ||
action | slot | Action or illustration in the top right corner | ||
title | string | Page title | ||
text | string | Optional text. | ||
date | string | Optional pre-formatted date line. |
Drawer
Drawer: drawer

| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | yes | Unique DOM id of the drawer | |
title | string | Title of the drawer | ||
content | slot | The content that goes in the drawers' scrolling area. |
Warnings
Warnings: warning

local warnings = require("turn.healthpass.ds.components.warnings")
warnings.warning({
illustration = ENUM,
text = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
illustration | enum, one of 29 names (see Foundations) | yes | Illustration, e.g folder with exclamation mark 'error-access-denied' | |
text | string | yes | The message under the illustration, e.g 'Access denied'. |
Warnings: error

local warnings = require("turn.healthpass.ds.components.warnings")
warnings.warning({
illustration = ENUM,
text = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
illustration | enum, one of 29 names (see Foundations) | yes | Illustration, e.g folder with exclamation mark 'error-access-denied' | |
text | string | yes | The message under the illustration, e.g 'Access denied'. |
Buttons
Buttons: button

local buttons = require("turn.healthpass.ds.components.buttons")
buttons.button({
variant = ENUM,
label = STRING,
icon = ENUM,
icon_class = STRING,
href = STRING,
download = STRING,
aria_label = STRING,
attrs = TABLE,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
variant | enum, one of primary, secondary, ghost | primary | Primary (green background), secondary (white background) or ghost. | |
label | string | Button label (omit for an icon-only button) | ||
icon | enum, one of 23 names (see Foundations) | Optional icon name, e.g. 'arrow-right' | ||
icon_class | string | w-6 h-6 | Utility classes on the icon; replaces the sizing default. | |
href | string | Link target. When set the button renders as an anchor, otherwise a button element. | ||
download | string | Download filename; renders the anchor's download attribute. Requires href. | ||
aria_label | string | Accessible name, required for an icon-only button. | ||
attrs | table | Pass-through attributes, restricted to data-, hx- and aria-*. E.g. { ['data-drawer-open'] = '' }. |
Buttons: label only

local buttons = require("turn.healthpass.ds.components.buttons")
buttons.button({
variant = ENUM,
label = STRING,
icon = ENUM,
icon_class = STRING,
href = STRING,
download = STRING,
aria_label = STRING,
attrs = TABLE,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
variant | enum, one of primary, secondary, ghost | primary | Primary (green background), secondary (white background) or ghost. | |
label | string | Button label (omit for an icon-only button) | ||
icon | enum, one of 23 names (see Foundations) | Optional icon name, e.g. 'arrow-right' | ||
icon_class | string | w-6 h-6 | Utility classes on the icon; replaces the sizing default. | |
href | string | Link target. When set the button renders as an anchor, otherwise a button element. | ||
download | string | Download filename; renders the anchor's download attribute. Requires href. | ||
aria_label | string | Accessible name, required for an icon-only button. | ||
attrs | table | Pass-through attributes, restricted to data-, hx- and aria-*. E.g. { ['data-drawer-open'] = '' }. |
Buttons: icon only
local buttons = require("turn.healthpass.ds.components.buttons")
buttons.button({
variant = ENUM,
label = STRING,
icon = ENUM,
icon_class = STRING,
href = STRING,
download = STRING,
aria_label = STRING,
attrs = TABLE,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
variant | enum, one of primary, secondary, ghost | primary | Primary (green background), secondary (white background) or ghost. | |
label | string | Button label (omit for an icon-only button) | ||
icon | enum, one of 23 names (see Foundations) | Optional icon name, e.g. 'arrow-right' | ||
icon_class | string | w-6 h-6 | Utility classes on the icon; replaces the sizing default. | |
href | string | Link target. When set the button renders as an anchor, otherwise a button element. | ||
download | string | Download filename; renders the anchor's download attribute. Requires href. | ||
aria_label | string | Accessible name, required for an icon-only button. | ||
attrs | table | Pass-through attributes, restricted to data-, hx- and aria-*. E.g. { ['data-drawer-open'] = '' }. |
Badges
Badges: badge

local badges = require("turn.healthpass.ds.components.badges")
badges.badge({
state = ENUM,
icon = ENUM,
text = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
state | enum, one of success, warning, alert | yes | Visual state: green, yellow or red. | |
icon | enum, one of 23 names (see Foundations) | yes | Icon name, sized and colored to match the pill. | |
text | string | yes | Short status text, e.g. 'Done'. |
Badges: count badge
local badges = require("turn.healthpass.ds.components.badges")
badges.count_badge({
count = NUMBER,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
count | number | yes | The count to display. |
Date tile
Date tile: january
local date_tile = require("turn.healthpass.ds.components.date_tile")
date_tile.date_tile({
date = DATE,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
date | date | yes | ISO date, e.g. '2026-05-12'; the tile shows a three-letter month and the day. |
Date tile: may
local date_tile = require("turn.healthpass.ds.components.date_tile")
date_tile.date_tile({
date = DATE,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
date | date | yes | ISO date, e.g. '2026-05-12'; the tile shows a three-letter month and the day. |
Date tile: july
local date_tile = require("turn.healthpass.ds.components.date_tile")
date_tile.date_tile({
date = DATE,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
date | date | yes | ISO date, e.g. '2026-05-12'; the tile shows a three-letter month and the day. |
Pin input
Pin input: pin input
local pin_input = require("turn.healthpass.ds.components.pin_input")
pin_input.pin_input({
invalid = BOOLEAN,
error = STRING,
submit_url = STRING,
token = STRING,
original_path = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
invalid | boolean | false | Render the error state (red cells), e.g. after a wrong PIN. | |
error | string | Message announced to screen readers when the PIN is rejected, e.g. 'Incorrect PIN'. | ||
submit_url | string | Where the filled field posts the PIN. Without one, filling the field does nothing. | ||
token | string | The one-time token from the visitor's link, posted with the PIN. | ||
original_path | string | Where the visitor was heading when they were asked for the PIN, posted with it. |
Pin input: invalid
local pin_input = require("turn.healthpass.ds.components.pin_input")
pin_input.pin_input({
invalid = BOOLEAN,
error = STRING,
submit_url = STRING,
token = STRING,
original_path = STRING,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
invalid | boolean | false | Render the error state (red cells), e.g. after a wrong PIN. | |
error | string | Message announced to screen readers when the PIN is rejected, e.g. 'Incorrect PIN'. | ||
submit_url | string | Where the filled field posts the PIN. Without one, filling the field does nothing. | ||
token | string | The one-time token from the visitor's link, posted with the PIN. | ||
original_path | string | Where the visitor was heading when they were asked for the PIN, posted with it. |
Pin input: pin code
local pin_input = require("turn.healthpass.ds.components.pin_input")
pin_input.pin_code({
code = DIGITS,
})
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
code | digits | yes | The digits to display. |