Componentes do design system
Todos os componentes de turn.healthpass.ds, tal como o storybook os mostra. Cada captura de tela é o componente renderizado pela biblioteca e estilizado pela folha de estilos do design system, na largura de 440 px para a qual as páginas do paciente são desenhadas.
A chamada sob cada captura é a interface do componente, tirada da declaração das suas props: os marcadores são tipos, não valores de exemplo. SLOT recebe a saída de outro componente, STRING texto, ENUM um dos valores listados, TABLE uma tabela Lua, BOOLEAN true ou 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
date | date | sim | 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
text | string | Consult summary | Card heading. | |
details | string | Clinician line, e.g. 'With Ayanda Mokoena'. | ||
date | date | sim | 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
icon | slot | Leading illustration. | ||
text | string | sim | Menu label, e.g. 'Test Results'. | |
count | number | 0 | Optional tally shown in a green circle; hidden when 0. | |
trailing_icon | enum, um de 23 nomes (ver 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
content | slot | sim | 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
title | string | Optional heading above the panel, e.g. 'Visit Summary'. | ||
color | enum, um de purple, green, blue, gray, orange, yellow, red | gray | Heading color. | |
variant | enum, um de cards, text | cards | What the panel holds: a stack of cards, or a block of copy. | |
content | slot | sim | 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
title | string | Optional heading above the panel, e.g. 'Visit Summary'. | ||
color | enum, um de purple, green, blue, gray, orange, yellow, red | gray | Heading color. | |
variant | enum, um de cards, text | cards | What the panel holds: a stack of cards, or a block of copy. | |
content | slot | sim | 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
title | string | Optional heading above the panel, e.g. 'Visit Summary'. | ||
color | enum, um de purple, green, blue, gray, orange, yellow, red | gray | Heading color. | |
variant | enum, um de cards, text | cards | What the panel holds: a stack of cards, or a block of copy. | |
content | slot | sim | 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
color | enum, um de 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
color | enum, um de 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
color | enum, um de 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
color | enum, um de 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
id | string | sim | 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
illustration | enum, um de 29 nomes (ver Foundations) | sim | Illustration, e.g folder with exclamation mark 'error-access-denied' | |
text | string | sim | 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
illustration | enum, um de 29 nomes (ver Foundations) | sim | Illustration, e.g folder with exclamation mark 'error-access-denied' | |
text | string | sim | 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
variant | enum, um de primary, secondary, ghost | primary | Primary (green background), secondary (white background) or ghost. | |
label | string | Button label (omit for an icon-only button) | ||
icon | enum, um de 23 nomes (ver 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
variant | enum, um de primary, secondary, ghost | primary | Primary (green background), secondary (white background) or ghost. | |
label | string | Button label (omit for an icon-only button) | ||
icon | enum, um de 23 nomes (ver 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
variant | enum, um de primary, secondary, ghost | primary | Primary (green background), secondary (white background) or ghost. | |
label | string | Button label (omit for an icon-only button) | ||
icon | enum, um de 23 nomes (ver 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
state | enum, um de success, warning, alert | sim | Visual state: green, yellow or red. | |
icon | enum, um de 23 nomes (ver Foundations) | sim | Icon name, sized and colored to match the pill. | |
text | string | sim | Short status text, e.g. 'Done'. |
Badges: count badge
local badges = require("turn.healthpass.ds.components.badges")
badges.count_badge({
count = NUMBER,
})
| Prop | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
count | number | sim | 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
date | date | sim | 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
date | date | sim | 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
date | date | sim | 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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
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 | Tipo | Obrigatória | Padrão | Descrição |
|---|---|---|---|---|
code | digits | sim | The digits to display. |