Side Nav Item
@astryxdesign/core v0.7.1 · SideNavItem
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Visible name of the item. Becomes the accessible name of the icon-only row and of the collapsed popover. Required. |
href | string | — | Navigation target URL. Without it the row is a button that only emits click. |
as | NavLinkComponent | 'a' | Custom link root component, such as RouterLink. It receives the address as to as well. Used only when there is an address. |
target | string | — | Link target. A new-window target also adds noopener noreferrer. |
rel | string | — | Link rel. Merged with the noopener noreferrer that a new-window target adds. |
iconClass | string | — | Icon before the label, given as a CSS icon class such as i-carbon-home. An item without an icon is left out while the rail is collapsed. |
selectedIconClass | string | — | Icon used instead of iconClass while the item is selected. |
isSelected | boolean | false | Whether this is the current page. Sets aria-current="page" and the selected styles. |
isDisabled | boolean | false | Whether the item is disabled. Blocks the default action and emits nothing. |
size | 'sm' | 'md' | 'lg' | 'md' | Height and horizontal padding of the row. |
collapsible | boolean | { defaultIsCollapsed?: boolean, isCollapsed?: boolean } | — | Whether the children can be folded. Left unset, a row with children folds. false keeps them open. The object form sets the starting or the controlled state. |
Events
click(event: MouseEvent): fires when the row is clicked. A disabled item blocks the default action and emits nothing.
Slots
default: child items. A row with children folds them into a group.icon: icon element before the label. An alternative toiconClass.selectedIcon: icon element used while the item is selected. Falls back toicon.end: content at the trailing edge of the row, such as a badge or a count.