Skip to main content

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​

Storybook

Read Only Preview​

Storybook

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​

VariantWhat it is
tabsStaff or portal tab sets.
lockRead-only preview banner.
no tabsFlows 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​

PropTypeDefaultDescription
title *ReactNode—Screen title. Required
subtitleReactNodenonePatient or date line
backstringnoneBack link href
onBack(event: MouseEvent<HTMLAnchorElement>) => voidnoneCalled when the back link is clicked (client-side routing)
actionReactNodenoneOne small header action on the right
tabsBottomTabBarItem[]none (no tab bar)BottomTabBar items
activestringnoneLabel of the current tab
onNavigate(item: BottomTabBarItem, event: MouseEvent<HTMLAnchorElement>) => voidnoneCalled when a tab is clicked
lockTextReactNodenoneRead-only lock banner at the top of the body
childrenReactNode—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>
KindNameDescription
attributebackBack link href; default none
property / JSON attributetabsBottomTabBar items; default none (no tab bar)
attributeactiveLabel of the current tab; default none
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
eventco-backCalled when the back link is clicked (client-side routing); default none (React: onBack)
eventco-navigateCalled when a tab is clicked; default none (React: onNavigate)
slottitleScreen title. Required Plain text also works as the `title` attribute.
slotsubtitlePatient or date line; default none Plain text also works as the `subtitle` attribute.
slotactionOne small header action on the right; default none Plain text also works as the `action` attribute.
slotlock-textRead-only lock banner at the top of the body; default none Plain text also works as the `lock-text` attribute.
slot(default)Body.