Skip to main content

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: Colors

Foundations: fonts​

Foundations: Fonts

Foundations: icons​

Foundations: Icons

Foundations: illustrations​

Foundations: Illustrations

Cards​

Cards: base card​

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,
})
PropTypeRequiredDefaultDescription
hrefstringAbsolute link target, e.g. '/apps/<uuid>/vitals'. When set, the whole card is a link.
iconslotLeading visual: an icon or a small component (e.g. a date tile).
labelstringSmall heading above the values.
textstringPrimary text value.
numberstringProminent pre-formatted value, e.g. '120/80 mmHG'
detailsstringSupporting copy under the values.
datestringPre-formatted date line.
statusslotTrailing status, e.g. a badge.
trailing_iconslotRight-aligned affordance icon (chevron, check, eye).
attrstablePass-through attributes on the card link, restricted to data-, hx- and aria-*.
downloadstringDownload filename; renders the link's download attribute. Requires href.

Cards: text card​

Cards: Text card

local cards = require("turn.healthpass.ds.components.cards")

cards.text_card({
icon = SLOT,
text = STRING,
details = STRING,
})
PropTypeRequiredDefaultDescription
iconslotLeading icon.
textstringCard heading, e.g. 'What you reported'.
detailsstringBody copy.

Cards: vitals card​

Cards: Vitals card

local cards = require("turn.healthpass.ds.components.cards")

cards.vitals_card({
label = STRING,
number = STRING,
date = STRING,
})
PropTypeRequiredDefaultDescription
labelstringReading name, e.g. 'Blood pressure'.
numberstringPre-formatted reading, e.g. '120/80 mmHG'.
datestringPre-formatted date line.

Cards: prescription card​

Cards: Prescription card

local cards = require("turn.healthpass.ds.components.cards")

cards.prescription_card({
text = STRING,
details = STRING,
date = STRING,
href = STRING,
})
PropTypeRequiredDefaultDescription
textstringCard heading, e.g. 'Prescription'.
detailsstringSupporting copy.
datestringPre-formatted date line.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: sicknote card​

Cards: Sicknote card

local cards = require("turn.healthpass.ds.components.cards")

cards.sicknote_card({
text = STRING,
details = STRING,
date = STRING,
href = STRING,
})
PropTypeRequiredDefaultDescription
textstringCard heading, e.g. 'Sick note'.
detailsstringSupporting copy.
datestringPre-formatted date line.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: labresults card​

Cards: Labresults card

local cards = require("turn.healthpass.ds.components.cards")

cards.labresults_card({
text = STRING,
details = STRING,
date = STRING,
href = STRING,
})
PropTypeRequiredDefaultDescription
textstringCard heading, e.g. 'Lab results'.
detailsstringSupporting copy.
datestringPre-formatted date line.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: referral card​

Cards: Referral card

local cards = require("turn.healthpass.ds.components.cards")

cards.referral_card({
text = STRING,
details = STRING,
date = STRING,
href = STRING,
})
PropTypeRequiredDefaultDescription
textstringCard heading, e.g. 'Referral'.
detailsstringSupporting copy.
datestringPre-formatted date line.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: visitsummary card​

Cards: Visitsummary card

local cards = require("turn.healthpass.ds.components.cards")

cards.visitsummary_card({
text = STRING,
details = STRING,
date = STRING,
href = STRING,
})
PropTypeRequiredDefaultDescription
textstringCard heading, e.g. 'Visit summary'.
detailsstringSupporting copy.
datestringPre-formatted date line.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: visit card​

Cards: Visit card

local cards = require("turn.healthpass.ds.components.cards")

cards.visit_card({
date = DATE,
text = STRING,
details = STRING,
href = STRING,
})
PropTypeRequiredDefaultDescription
datedateyesVisit date for the calendar tile.
textstringSpecialty, e.g. 'Otorhinolaryngology'.
detailsstringProvider, e.g. 'Maria Silva at Turn Health'.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: consult card​

Cards: Consult card

local cards = require("turn.healthpass.ds.components.cards")

cards.consult_card({
text = STRING,
details = STRING,
date = DATE,
href = STRING,
})
PropTypeRequiredDefaultDescription
textstringConsult summaryCard heading.
detailsstringClinician line, e.g. 'With Ayanda Mokoena'.
datedateyesWhen the consult was; renders as '15 Jul 2026, 9:30'.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: about card​

Cards: About card

local cards = require("turn.healthpass.ds.components.cards")

cards.about_card({
label = STRING,
text = STRING,
})
PropTypeRequiredDefaultDescription
labelstringField name, e.g. 'Name'.
textstringField value, e.g. 'Sashi Hlophe'.

Cards: medication card​

Cards: Medication card

local cards = require("turn.healthpass.ds.components.cards")

cards.medication_card({
text = STRING,
details = STRING,
})
PropTypeRequiredDefaultDescription
textstringMedication, e.g. 'Amoxicilin 500MG Oral tablet'.
detailsstringDosing, e.g. '2 times daily'.

Cards: vaccination card​

Cards: Vaccination card

local cards = require("turn.healthpass.ds.components.cards")

cards.vaccination_card({
text = STRING,
date = STRING,
})
PropTypeRequiredDefaultDescription
textstringVaccine, e.g. 'COVID-19'.
datestringPre-formatted date line.

Cards: vitals detail card​

Cards: Vitals detail card

local cards = require("turn.healthpass.ds.components.cards")

cards.vitals_detail_card({
number = STRING,
date = STRING,
status = SLOT,
})
PropTypeRequiredDefaultDescription
numberstringPre-formatted reading, e.g. '120/80 mmHG'.
datestringPre-formatted date line.
statusslotStatus badge, e.g. badges.badge output.

Cards: lab test result card​

Cards: Lab test result card

local cards = require("turn.healthpass.ds.components.cards")

cards.lab_test_result_card({
label = STRING,
number = STRING,
status = SLOT,
})
PropTypeRequiredDefaultDescription
labelstringMeasure name, e.g. 'Hematocrit'.
numberstringPre-formatted value, e.g. '34%'.
statusslotStatus badge, e.g. badges.badge output.

Cards: lab test card​

Cards: Lab test card

local cards = require("turn.healthpass.ds.components.cards")

cards.lab_test_card({
text = STRING,
status = SLOT,
href = STRING,
})
PropTypeRequiredDefaultDescription
textstringTest name, e.g. 'CBC Panel - Blood by automated count'.
statusslotStatus badge, e.g. badges.badge output.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: allergy card​

Cards: Allergy card

local cards = require("turn.healthpass.ds.components.cards")

cards.allergy_card({
text = STRING,
details = STRING,
status = SLOT,
href = STRING,
})
PropTypeRequiredDefaultDescription
textstringAllergen, e.g. 'Penicilin'.
detailsstringCategory, e.g. 'Medication'.
statusslotStatus badge, e.g. badges.badge output.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: menu item card​

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,
})
PropTypeRequiredDefaultDescription
iconslotLeading illustration.
textstringyesMenu label, e.g. 'Test Results'.
countnumber0Optional tally shown in a green circle; hidden when 0.
trailing_iconenum, one of 23 names (see Foundations)Trailing icon, e.g. 'eye'. Defaults to a chevron when href is set.
hrefstringLink target; when set the card is a link and shows the chevron affordance.
attrstablePass-through attributes on the card link, restricted to data-, hx- and aria-*.
downloadstringDownload filename; renders the link's download attribute. Requires href.

Cards: selection list card​

Cards: Selection list card

local cards = require("turn.healthpass.ds.components.cards")

cards.selection_list_card({
text = STRING,
selected = BOOLEAN,
})
PropTypeRequiredDefaultDescription
textstringRow label, e.g. a family member's name.
selectedbooleanfalseWhether the row shows the selected check.

Richtext​

Richtext: elements​

Richtext: Elements

local richtext = require("turn.healthpass.ds.components.richtext")

richtext.body({
content = SLOT,
})
PropTypeRequiredDefaultDescription
contentslotyesThe HTML rich text snippet

Section​

Section: section​

Section: Section

local section = require("turn.healthpass.ds.components.section")

section.section({
title = STRING,
color = ENUM,
variant = ENUM,
content = SLOT,
})
PropTypeRequiredDefaultDescription
titlestringOptional heading above the panel, e.g. 'Visit Summary'.
colorenum, one of purple, green, blue, gray, orange, yellow, redgrayHeading color.
variantenum, one of cards, textcardsWhat the panel holds: a stack of cards, or a block of copy.
contentslotyesThe panel's content: ds cards, or a ds.richtext body.

Section: text​

Section: Text

local section = require("turn.healthpass.ds.components.section")

section.section({
title = STRING,
color = ENUM,
variant = ENUM,
content = SLOT,
})
PropTypeRequiredDefaultDescription
titlestringOptional heading above the panel, e.g. 'Visit Summary'.
colorenum, one of purple, green, blue, gray, orange, yellow, redgrayHeading color.
variantenum, one of cards, textcardsWhat the panel holds: a stack of cards, or a block of copy.
contentslotyesThe panel's content: ds cards, or a ds.richtext body.

Section: colors​

Section: Colors

local section = require("turn.healthpass.ds.components.section")

section.section({
title = STRING,
color = ENUM,
variant = ENUM,
content = SLOT,
})
PropTypeRequiredDefaultDescription
titlestringOptional heading above the panel, e.g. 'Visit Summary'.
colorenum, one of purple, green, blue, gray, orange, yellow, redgrayHeading color.
variantenum, one of cards, textcardsWhat the panel holds: a stack of cards, or a block of copy.
contentslotyesThe panel's content: ds cards, or a ds.richtext body.

Header: 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,
})
PropTypeRequiredDefaultDescription
colorenum, one of purple, green, blue, gray, orange, white, yellow, redgrayThe color of the header
backstringAbsolute link target, e.g. '/apps/<uuid>/vitals'. When set, the whole card is a link.
actionslotAction or illustration in the top right corner
titlestringPage title
textstringOptional text.
datestringOptional pre-formatted date line.

Header: header with date​

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,
})
PropTypeRequiredDefaultDescription
colorenum, one of purple, green, blue, gray, orange, white, yellow, redgrayThe color of the header
backstringAbsolute link target, e.g. '/apps/<uuid>/vitals'. When set, the whole card is a link.
actionslotAction or illustration in the top right corner
titlestringPage title
textstringOptional text.
datestringOptional pre-formatted date line.

Header: header with action​

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,
})
PropTypeRequiredDefaultDescription
colorenum, one of purple, green, blue, gray, orange, white, yellow, redgrayThe color of the header
backstringAbsolute link target, e.g. '/apps/<uuid>/vitals'. When set, the whole card is a link.
actionslotAction or illustration in the top right corner
titlestringPage title
textstringOptional text.
datestringOptional pre-formatted date line.

Header: header long content​

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,
})
PropTypeRequiredDefaultDescription
colorenum, one of purple, green, blue, gray, orange, white, yellow, redgrayThe color of the header
backstringAbsolute link target, e.g. '/apps/<uuid>/vitals'. When set, the whole card is a link.
actionslotAction or illustration in the top right corner
titlestringPage title
textstringOptional text.
datestringOptional pre-formatted date line.

Drawer​

Drawer: drawer​

Drawer: Drawer

Drawer: Drawer, open

PropTypeRequiredDefaultDescription
idstringyesUnique DOM id of the drawer
titlestringTitle of the drawer
contentslotThe content that goes in the drawers' scrolling area.

Warnings​

Warnings: warning​

Warnings: Warning

local warnings = require("turn.healthpass.ds.components.warnings")

warnings.warning({
illustration = ENUM,
text = STRING,
})
PropTypeRequiredDefaultDescription
illustrationenum, one of 29 names (see Foundations)yesIllustration, e.g folder with exclamation mark 'error-access-denied'
textstringyesThe message under the illustration, e.g 'Access denied'.

Warnings: error​

Warnings: Error

local warnings = require("turn.healthpass.ds.components.warnings")

warnings.warning({
illustration = ENUM,
text = STRING,
})
PropTypeRequiredDefaultDescription
illustrationenum, one of 29 names (see Foundations)yesIllustration, e.g folder with exclamation mark 'error-access-denied'
textstringyesThe message under the illustration, e.g 'Access denied'.

Buttons​

Buttons: button​

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,
})
PropTypeRequiredDefaultDescription
variantenum, one of primary, secondary, ghostprimaryPrimary (green background), secondary (white background) or ghost.
labelstringButton label (omit for an icon-only button)
iconenum, one of 23 names (see Foundations)Optional icon name, e.g. 'arrow-right'
icon_classstringw-6 h-6Utility classes on the icon; replaces the sizing default.
hrefstringLink target. When set the button renders as an anchor, otherwise a button element.
downloadstringDownload filename; renders the anchor's download attribute. Requires href.
aria_labelstringAccessible name, required for an icon-only button.
attrstablePass-through attributes, restricted to data-, hx- and aria-*. E.g. { ['data-drawer-open'] = '' }.

Buttons: label only​

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,
})
PropTypeRequiredDefaultDescription
variantenum, one of primary, secondary, ghostprimaryPrimary (green background), secondary (white background) or ghost.
labelstringButton label (omit for an icon-only button)
iconenum, one of 23 names (see Foundations)Optional icon name, e.g. 'arrow-right'
icon_classstringw-6 h-6Utility classes on the icon; replaces the sizing default.
hrefstringLink target. When set the button renders as an anchor, otherwise a button element.
downloadstringDownload filename; renders the anchor's download attribute. Requires href.
aria_labelstringAccessible name, required for an icon-only button.
attrstablePass-through attributes, restricted to data-, hx- and aria-*. E.g. { ['data-drawer-open'] = '' }.

Buttons: icon only​

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,
})
PropTypeRequiredDefaultDescription
variantenum, one of primary, secondary, ghostprimaryPrimary (green background), secondary (white background) or ghost.
labelstringButton label (omit for an icon-only button)
iconenum, one of 23 names (see Foundations)Optional icon name, e.g. 'arrow-right'
icon_classstringw-6 h-6Utility classes on the icon; replaces the sizing default.
hrefstringLink target. When set the button renders as an anchor, otherwise a button element.
downloadstringDownload filename; renders the anchor's download attribute. Requires href.
aria_labelstringAccessible name, required for an icon-only button.
attrstablePass-through attributes, restricted to data-, hx- and aria-*. E.g. { ['data-drawer-open'] = '' }.

Badges​

Badges: badge​

Badges: Badge

local badges = require("turn.healthpass.ds.components.badges")

badges.badge({
state = ENUM,
icon = ENUM,
text = STRING,
})
PropTypeRequiredDefaultDescription
stateenum, one of success, warning, alertyesVisual state: green, yellow or red.
iconenum, one of 23 names (see Foundations)yesIcon name, sized and colored to match the pill.
textstringyesShort status text, e.g. 'Done'.

Badges: count badge​

Badges: Count badge

local badges = require("turn.healthpass.ds.components.badges")

badges.count_badge({
count = NUMBER,
})
PropTypeRequiredDefaultDescription
countnumberyesThe count to display.

Date tile​

Date tile: january​

Date tile: January

local date_tile = require("turn.healthpass.ds.components.date_tile")

date_tile.date_tile({
date = DATE,
})
PropTypeRequiredDefaultDescription
datedateyesISO date, e.g. '2026-05-12'; the tile shows a three-letter month and the day.

Date tile: may​

Date tile: May

local date_tile = require("turn.healthpass.ds.components.date_tile")

date_tile.date_tile({
date = DATE,
})
PropTypeRequiredDefaultDescription
datedateyesISO date, e.g. '2026-05-12'; the tile shows a three-letter month and the day.

Date tile: july​

Date tile: July

local date_tile = require("turn.healthpass.ds.components.date_tile")

date_tile.date_tile({
date = DATE,
})
PropTypeRequiredDefaultDescription
datedateyesISO date, e.g. '2026-05-12'; the tile shows a three-letter month and the day.

Pin input​

Pin input: 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,
})
PropTypeRequiredDefaultDescription
invalidbooleanfalseRender the error state (red cells), e.g. after a wrong PIN.
errorstringMessage announced to screen readers when the PIN is rejected, e.g. 'Incorrect PIN'.
submit_urlstringWhere the filled field posts the PIN. Without one, filling the field does nothing.
tokenstringThe one-time token from the visitor's link, posted with the PIN.
original_pathstringWhere the visitor was heading when they were asked for the PIN, posted with it.

Pin input: invalid​

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,
})
PropTypeRequiredDefaultDescription
invalidbooleanfalseRender the error state (red cells), e.g. after a wrong PIN.
errorstringMessage announced to screen readers when the PIN is rejected, e.g. 'Incorrect PIN'.
submit_urlstringWhere the filled field posts the PIN. Without one, filling the field does nothing.
tokenstringThe one-time token from the visitor's link, posted with the PIN.
original_pathstringWhere the visitor was heading when they were asked for the PIN, posted with it.

Pin input: pin code​

Pin input: Pin code

local pin_input = require("turn.healthpass.ds.components.pin_input")

pin_input.pin_code({
code = DIGITS,
})
PropTypeRequiredDefaultDescription
codedigitsyesThe digits to display.