Skip to main content

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​

Storybook

Usage​

<BottomTabBar items={STAFF_TABS} active="Schedule" />

When to use​

  • Phone EHR and patient portal.

When not to use​

  • Desktop.

Variants and states​

VariantWhat it is
staffHome, Schedule, Patients, Messages, More.
portalHome, Appointments, Messages, Health, More.
badgeUnread 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​

PropTypeDefaultDescription
items *BottomTabBarItem[]—Four or five tabs. Required.
activestringnoneLabel of the current tab
labelstring"Main"Landmark name
onNavigate(item: BottomTabBarItem, event: MouseEvent<HTMLAnchorElement>) => voidnoneCalled 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>
KindNameDescription
property / JSON attributeitemsFour or five tabs. Required.
attributeactiveLabel of the current tab; default none
attributelabelLandmark name; default "Main"
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
eventco-navigateCalled when a tab is clicked; default none (React: onNavigate)