BottomTabBar
ComplexMobile and kiosk
<co-bottom-tab-bar>BottomTabBar is the phone and portal bottom navigation with four or five tabs and badges.
import { BottomTabBar } from 'health-components';
Examples
Staff And Portal
Usage
<BottomTabBar items={STAFF_TABS} active="Schedule" />
When to use
- Phone EHR and patient portal.
When not to use
- Desktop.
Variants and states
| Variant | What it is |
|---|---|
| staff | Home, Schedule, Patients, Messages, More. |
| portal | Home, Appointments, Messages, Health, More. |
| badge | Unread count. |
Accessibility
- nav with aria-current="page"; 56px targets.
Do and don't
- Do: Five tabs at most.
- Don't: Hide the bar on scroll in forms.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
items * | BottomTabBarItem[] | — | Four or five tabs. Required. |
active | string | none | Label of the current tab |
label | string | "Main" | Landmark name |
onNavigate | (item: BottomTabBarItem, event: MouseEvent<HTMLAnchorElement>) => void | none | Called when a tab is clicked |
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-bottom-tab-bar>. 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-bottom-tab-bar active="…" label="…" [items]="items" (co-navigate)="onNavigate($event.detail)"></co-bottom-tab-bar>
| Kind | Name | Description |
|---|---|---|
| property / JSON attribute | items | Four or five tabs. Required. |
| attribute | active | Label of the current tab; default none |
| attribute | label | Landmark name; default "Main" |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| event | co-navigate | Called when a tab is clicked; default none (React: onNavigate) |