Skip to main content

MobileHeader

ComplexMobile and kiosk<co-mobile-header>

MobileHeader is the dark bar at the top of phone, portal and kiosk screens, with back, title, subtitle and one action.

import { MobileHeader } from 'health-components';

Examples​

Variants​

Storybook

Kiosk​

Storybook

Usage​

<MobileHeader back="/m/patients" title="Henna West" subtitle="F 38 . MRN-100231" />

When to use​

  • Every phone, portal and kiosk screen.

When not to use​

  • Desktop: TopBar.

Variants and states​

VariantWhat it is
defaultTitle and subtitle.
backChevron back link.
actionOne small button on the right.
kioskWider, 19px title.

Accessibility​

  • Back link named "Back".
  • White on primary-strong passes 4.5:1 in all three light styles; Dark uses surface-alt with ink.

Do and don't​

  • Do: Subtitle with the patient or the date.
  • Don't: Two actions on the right.

Props​

PropTypeDefaultDescription
title *ReactNode—Screen title. Required.
subtitleReactNodenonePatient or date line
backstringnoneBack link href; shows the chevron back link
onBack(event: MouseEvent<HTMLAnchorElement>) => voidnoneCalled when the back link is clicked (client-side routing)
actionReactNodenoneOne small action on the right
variantMobileHeaderVariant'phone''phone' | 'kiosk' (wider, 19px title)

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-mobile-header>. 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-mobile-header back="…" variant="…" [defaultValue]="defaultValue" (co-back)="onBack($event.detail)"></co-mobile-header>
KindNameDescription
attributebackBack link href; shows the chevron back link; default none
attributevariant'phone' | 'kiosk' (wider, 19px title); default 'phone'
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)
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 action on the right; default none Plain text also works as the `action` attribute.