Skip to main content

SectionNav

BasicNavigation<co-section-nav>

SectionNav is the left list of sections inside a record, such as the 20 sections of a patient chart.

import { SectionNav } from 'health-components';

Examples​

Interactive​

Storybook

Claim Edit​

Storybook

Usage​

<SectionNav items={CHART_SECTIONS} active="Medications" onChange={goSection} />

When to use​

  • Records with many sections that are separate pages.

When not to use​

  • Two to six views: Tabs.

Variants and states​

VariantWhat it is
defaultActive item on primary-soft.
countsNumber after the label.

Accessibility​

  • nav landmark "Section menu", aria-current="page" on the active link.

Do and don't​

  • Do: Keep the order the same for every patient.
  • Don't: Hide sections per patient; show them empty.

Props​

PropTypeDefaultDescription
items *SectionNavItem[]—Sections, in the same order for every record. Required.
activestringnoneLabel of the current section
labelstring"Section menu"Landmark name
onChange(label: string) => voidnoneCalled with the clicked section label. Items without `href` do not navigate

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-section-nav>. 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-section-nav active="…" label="…" [items]="items" (co-change)="onChange($event.detail)"></co-section-nav>
KindNameDescription
property / JSON attributeitemsSections, in the same order for every record. Required.
attributeactiveLabel of the current section; default none
attributelabelLandmark name; default "Section menu"
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
eventco-changeCalled with the clicked section label. Items without `href` do not navigate; default none (React: onChange)