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
Kiosk
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
| Variant | What it is |
|---|---|
| default | Title and subtitle. |
| back | Chevron back link. |
| action | One small button on the right. |
| kiosk | Wider, 19px title. |
Accessibility
- Back link named "Back".
- White on
primary-strongpasses 4.5:1 in all three light styles; Dark usessurface-altwithink.
Do and don't
- Do: Subtitle with the patient or the date.
- Don't: Two actions on the right.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title * | ReactNode | — | Screen title. Required. |
subtitle | ReactNode | none | Patient or date line |
back | string | none | Back link href; shows the chevron back link |
onBack | (event: MouseEvent<HTMLAnchorElement>) => void | none | Called when the back link is clicked (client-side routing) |
action | ReactNode | none | One small action on the right |
variant | MobileHeaderVariant | '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>
| Kind | Name | Description |
|---|---|---|
| attribute | back | Back link href; shows the chevron back link; default none |
| attribute | variant | 'phone' | 'kiosk' (wider, 19px title); default 'phone' |
| 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) |
| 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 action on the right; default none Plain text also works as the `action` attribute. |