Vertical Navigation
- HTML/CSS:Dev Ready
- Web Component:In Progress (1 of 2 variants)
- Layout:Responsive
Sections
List#
<div class="demo-only" style="width:320px">
<nav class="slds-nav-vertical" aria-label="Sub page">
<div class="slds-nav-vertical__section">
<h2 id="entity-header" class="slds-nav-vertical__title">Reports</h2>
Accessibility Note
The
aria-current
attribute is used when an element within a set (e.g., navigation list items) is styled to indicate the selected or active item. In our use case, the attribute should be placed on theslds-nav-vertical__action
link element. In our example above, we're using the generictrue
value, but the attribute will accept a variety of options depending on your use case.For more information on
aria-current
, please visit the W3C specification page.
States#
Collapsed#
<div class="demo-only" style="width:320px">
<nav class="slds-nav-vertical" aria-label="Sub page">
<div class="slds-nav-vertical__section">
<h2 id="entity-header" class="slds-nav-vertical__title">Reports</h2>
Expanded#
<div class="demo-only" style="width:320px">
<nav class="slds-nav-vertical" aria-label="Sub page">
<div class="slds-nav-vertical__section">
<h2 id="entity-header" class="slds-nav-vertical__title">Reports</h2>
Examples#
Compact#
<div class="demo-only" style="width:320px">
<nav class="slds-nav-vertical slds-nav-vertical_compact" aria-label="Sub page">
<div class="slds-nav-vertical__section">
<h2 id="entity-header" class="slds-nav-vertical__title">Reports</h2>
Items with Icons#
<div class="demo-only" style="width:320px">
<nav class="slds-nav-vertical" aria-label="Sub page">
<div class="slds-nav-vertical__section">
<h2 id="entity-header" class="slds-nav-vertical__title">Reports</h2>
Items with Notifications#
<div class="demo-only" style="width:320px">
<nav class="slds-nav-vertical" aria-label="Sub page">
<div class="slds-nav-vertical__section">
<h2 id="entity-header" class="slds-nav-vertical__title">Reports</h2>
Shaded Background#
<div class="demo-only" style="width:320px;background-color:#FAFAFB">
<nav class="slds-nav-vertical slds-nav-vertical_shade" aria-label="Sub page">
<div class="slds-nav-vertical__section">
<h2 id="entity-header" class="slds-nav-vertical__title">Reports</h2>
Quickfind#
<div class="demo-only" style="width:320px">
<nav class="slds-nav-vertical" aria-label="Sub page">
<div class="slds-form-element slds-p-horizontal_large">
<label class="slds-form-element__label slds-assistive-text" for="input-id-01">Filter navigation items</label>
Radio Group#
The radio group variant should be used when your vertical navigation acts as a selection or filter on content, like within a modal. If the vertical navigation takes the user to another page or part of a page, use the standard List version. If your content changes entirely whenever options in the navigation are selected, instead of filtering one master list, then use the Vertical Tabs component.
<div class="slds-nav-vertical__section">
<div>
<fieldset class="slds-nav-vertical">
<legend class="slds-nav-vertical__title">Reports</legend>
Examples#
Compact#
<div class="slds-nav-vertical__section">
<div>
<fieldset class="slds-nav-vertical slds-nav-vertical_compact">
<legend class="slds-nav-vertical__title">Reports</legend>
Shaded Background#
<div class="demo-only" style="background-color:#FAFAFB">
<div class="slds-nav-vertical__section">
<div>
<fieldset class="slds-nav-vertical slds-nav-vertical_shade">
Overview of CSS Classes#
- Selector
- The CSS class being referred to.
- Summary
- A description of what the class does.
- Support
- Whether the class name is dev-ready (meaning it's fully vetted and tested and safe to use) or prototype (which means it's not fully vetted yet).
- Restrict
- The selector that the class name is allowed to be used on.
- Variant
- The base level pattern for a component. A variant can be extended to create another variant of that component, for example, a stateful button is a derivative of the base button.
- Modifier
- A single class that can be added to an HTML element of a component to modify its output. Typically these will be colors, sizing and positioning.
Selector | .slds-nav-vertical |
---|---|
Summary | |
Support | dev-ready |
Restrict | nav, fieldset |
Variant | True |
Selector | .slds-nav-vertical_compact |
---|---|
Summary | Modifer to reduce spacing between navigation items |
Restrict | .slds-nav-vertical |
Modifier | True |
Selector | .slds-nav-vertical_shade |
---|---|
Summary | Modifier to adjust list item when vertical navigation is sitting on top of a shaded background |
Restrict | .slds-nav-vertical |
Modifier | True |
Selector | .slds-nav-vertical__title |
---|---|
Summary | Section title of the vertical navigation |
Restrict | .slds-nav-vertical h2, .slds-nav-vertical legend |
Selector | .slds-nav-vertical__item |
---|---|
Summary | List of the vertical navigation |
Restrict | .slds-nav-vertical li, .slds-nav-vertical span |
Selector | .slds-is-active |
---|---|
Summary | Active state of a list item within a vertical navigation |
Restrict | .slds-nav-vertical__item |
Modifier | True |
Selector | .slds-nav-vertical__action |
---|---|
Summary | Actionable element inside of vertical navigation list item |
Restrict | .slds-nav-vertical a, .slds-nav-vertical button, .slds-nav-vertical label |
Selector | .slds-nav-vertical__action_overflow |
---|---|
Summary | Actionable element that toggles visibility of overflown list items |
Restrict | .slds-nav-vertical__action |
Selector | .slds-nav-vertical__action-text |
---|---|
Summary | Text inside of actionable element that toggles visibility of overflown list items |
Restrict | .slds-nav-vertical__action_overflow span |
Selector | .slds-nav-vertical_radio-faux |
---|---|
Summary | Used for styling the radio button |
Restrict | .slds-nav-vertical__action span |
Selector | .slds-nav-vertical__item [type="radio"] |
---|---|
Summary | Version of vertical nav that uses radio buttons |
Support | dev-ready |
Restrict | .slds-nav-vertical |
Variant | True |
Vertical Navigation Release Notes
2.15.8
Changed
- Replaced checked radio group navigation item background token with
BRAND_BACKGROUND_PRIMARY
branding token.
2.10.0
Added
- Added right-to-left specific selector to
slds-nav-vertical__action_overflow slds-button__icon
to allow the icon to rotate in the proper direction in right-to-left languages. - Added right-to-left specific selector to
slds-nav-vertical__action
to place thebox-shadow
in the correct location in right-to-left languages.
2.9.0
Changed
- Replaced active navigation item background token with
BRAND_PRIMARY_TRANSPARENT_10
branding token.
2.8.0
Changed
- Increased font size to 16px and applied bold font weight to
slds-nav-vertical__title
. - Increased left padding in
slds-nav-vertical__action
. - Changed background color of the selected
slds-nav-vertical__item
element in the shaded background example to be white. - Moved the
aria-describedby
attribute from the individual navigation<a />
links to the list<ul>
.
Removed
- Removed
slds-text-title_caps
from vertical navigation titles.