Nav
The Nav component provides a reusable pattern for nav in the interface.
Vertical navigation
Vertical navigation (with border)
Vertical navigation (with border and indented)
Horizontal navigation
Horizontal navigation (with dropdown)
Horizontal navigation (extended dropdown)
Horizontal navigation with the extended mega-menu dropdown enabled via isExtendedDropdown, presenting child items in a full-width panel.
-
Arbete
-
Kommun och politik
Navigation with tile-style items
Horizontal navigation where each item uses the tiles style, rendering links as card-like tiles with an icon and label.
Navigation with button-style items
Navigation mixing button-style items with default links, demonstrating how individual items can be rendered as filled or outlined buttons.
Vertical navigation with active and ancestor state
Vertical navigation with a current-page item (active) and its expanded parent (ancestor), showing how the component highlights the active trail.
API
| Parameter | Default | Type | Description |
|---|---|---|---|
|
items
|
[] | array | - |
|
direction
|
vertical | string | - |
|
includeToggle
|
false | boolean | - |
|
isExtendedDropdown
|
false | boolean | - |
|
allowStyle
|
true | boolean | - |
|
buttonStyle
|
filled | string | - |
|
buttonColor
|
primary | string | - |
|
expandLabel
|
Expand | string | - |
|
height
|
string | - | |
|
compressed
|
false | boolean | - |
|
expandIcon
|
expand_more | string | - |
|
indentSubLevels
|
false | boolean | - |
|
depth
|
null | ?integer | - |
CSS API
| Variable | Default | Type | Values | Description |
|---|---|---|---|---|
|
--c-nav--base
|
var(--base) | range | - | Main unit that drives radius and spacing scales. |
|
--c-nav--border-radius
|
var(--border-radius) | range | - | Border Radius |
|
--c-nav--color--surface
|
var(--color--surface) | color | - | Surface |
|
--c-nav--color--primary
|
var(--color--primary) | color | - | Primary |
|
--c-nav--shadow-color
|
var(--shadow-color) | rgba | - | Shadow Color |
|
--c-nav--shadow-amount
|
var(--shadow-amount) | range | - | Multiplier for elevation shadows. 0 = none, 1 = default. |
|
--c-nav--color--primary-contrast
|
var(--color--primary-contrast) | color | - | Primary Contrast |
|
--c-nav--color--surface-border
|
var(--color--surface-border) | color | - | Manual companion token for borders on surface elements. |
|
--c-nav--color--surface-contrast
|
var(--color--surface-contrast) | color | - | Used for text and icons on surface backgrounds with less contrast. |
|
--c-nav--font-size-300
|
var(--font-size-300) | range | - | Two steps above base in the type scale. Equivalent to h5. |