PhoneScaffold
ComplexMobile and kiosk
<co-phone-scaffold>PhoneScaffold is the frame for every phone and portal screen: header, scrolling body with 44px targets, optional lock banner and bottom tabs.
import { PhoneScaffold } from 'health-components';
Examples
Showcase
Read Only Preview
Usage
<PhoneScaffold title="Today" subtitle="Thu, Oct 9" tabs={STAFF_TABS} active="Home">
{appointments.map(a => <AppointmentChip key={a.id} {...a} />)}
</PhoneScaffold>
When to use
- mob-* and portal-* screens.
When not to use
- Kiosk: KioskStep.
Variants and states
| Variant | What it is |
|---|---|
| tabs | Staff or portal tab sets. |
| lock | Read-only preview banner. |
| no tabs | Flows such as login and scribe recording. |
Accessibility
- Controls inside get 44px min height.
Do and don't
- Do: One primary action per screen, full width.
- Don't: Desktop tables inside a phone frame.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title * | ReactNode | — | Screen title. Required |
subtitle | ReactNode | none | Patient or date line |
back | string | none | Back link href |
onBack | (event: MouseEvent<HTMLAnchorElement>) => void | none | Called when the back link is clicked (client-side routing) |
action | ReactNode | none | One small header action on the right |
tabs | BottomTabBarItem[] | none (no tab bar) | BottomTabBar items |
active | string | none | Label of the current tab |
onNavigate | (item: BottomTabBarItem, event: MouseEvent<HTMLAnchorElement>) => void | none | Called when a tab is clicked |
lockText | ReactNode | none | Read-only lock banner at the top of the body |
children | ReactNode | — | Body. |
Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, plus className and event handlers on the root element.
Angular, Vue and HTML
Register the elements once (Angular guide), then use <co-phone-scaffold>. Attributes take strings; arrays and objects are set as properties (Angular [prop], Vue :prop) or as JSON attributes. Callbacks are DOM events with the value in event.detail.
Angular template
<co-phone-scaffold back="…" active="…" [tabs]="tabs" (co-back)="onBack($event.detail)">…</co-phone-scaffold>
| Kind | Name | Description |
|---|---|---|
| attribute | back | Back link href; default none |
| property / JSON attribute | tabs | BottomTabBar items; default none (no tab bar) |
| attribute | active | Label of the current tab; default none |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| event | co-back | Called when the back link is clicked (client-side routing); default none (React: onBack) |
| event | co-navigate | Called when a tab is clicked; default none (React: onNavigate) |
| slot | title | Screen title. Required Plain text also works as the `title` attribute. |
| slot | subtitle | Patient or date line; default none Plain text also works as the `subtitle` attribute. |
| slot | action | One small header action on the right; default none Plain text also works as the `action` attribute. |
| slot | lock-text | Read-only lock banner at the top of the body; default none Plain text also works as the `lock-text` attribute. |
| slot | (default) | Body. |