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
Claim Edit
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
| Variant | What it is |
|---|---|
| default | Active item on primary-soft. |
| counts | Number 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
| Prop | Type | Default | Description |
|---|---|---|---|
items * | SectionNavItem[] | — | Sections, in the same order for every record. Required. |
active | string | none | Label of the current section |
label | string | "Section menu" | Landmark name |
onChange | (label: string) => void | none | Called 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>
| Kind | Name | Description |
|---|---|---|
| property / JSON attribute | items | Sections, in the same order for every record. Required. |
| attribute | active | Label of the current section; default none |
| attribute | label | Landmark name; default "Section menu" |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| event | co-change | Called with the clicked section label. Items without `href` do not navigate; default none (React: onChange) |