vertical-tabs
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
About Vertical Tabs
The Vertical Tabs component serves as a container to show groups of content, divided into tabs. Each tab label should correspond with a block of related content. Only one tab's contents are visible at any given time.
This component varies from the regular 'tabs' component, with the tabs arranged on the left in a vertical space, instead of on the top in a horizontal space.
Implementation
The Tab Component has the following markup requirements:
- The
.slds-is-activemodifier class is required on the.slds-vertical-tabs__nav-itemelement that is active (its content is being shown). - The
.slds-has-focusmodifier class is required on the.slds-vertical-tabs__nav-itemelement that has focus. - The
.slds-showmodifier class is required on the.slds-vertical-tabs__contentelement that is being shown (their tab label is selected). - The
.slds-hidemodifier class is required on all.slds-vertical-tabs__contentelements that are not being shown (their tab label is not selected). - If an icon or badge is to be used in combination with a tab nav item label, you can wrap an icon on the left of the label in a
spanwith the classslds-vertical-tabs__left-icon. If you require an icon or badge to the right of the label, you can wrap the element in aspanwith the classslds-vertical-tabs__right-icon.
Accessibility
Vertical Tabbed UIs have three parts with specific
ARIA Roles
- The tab list, which should have
role="tablist" - The tabs in that list, which should each be an
<a role="tab">anchor wrapped in a<li role="presentation">li - The tab panels, which display each tab's content and should each have
role="tabpanel"
Markup
- Selected tab’s anchor has
aria-selected="true", all other tabs’ anchors havearia-selected="false" - Selected tab’s anchor has
tabindex="0", all other tabs havetabindex="-1" - Each tab’s anchor has an
aria-controlsattribute whose value is the id of the associated<div role="tabpanel"> - Each tab panel has an
aria-labelledbyattribute whose value is the id of its associated<a role="tab">
Keyboard Interactions
- Arrow keys, when focus is on selected tab, cycle selection to the next or previous tab
- Tab key, when focus is before the tab list, moves focus to the selected tab
- Tab key, when focus is on selected tab, moves focus into the selected tab’s associated tab panel or to the next focusable element on the page if that panel has no focusable elements
- Shift+Tab keys, when focus is on first element in a tab panel, move focus to the selected tab
Base
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
<div class="slds-vertical-tabs">
<ul class="slds-vertical-tabs__nav" role="tablist" aria-orientation="vertical">
<li class="slds-vertical-tabs__nav-item slds-is-active" title="Tab 1" role="presentation">Examples
With Icons
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
<div class="slds-vertical-tabs">
<ul class="slds-vertical-tabs__nav" role="tablist" aria-orientation="vertical">
<li class="slds-vertical-tabs__nav-item slds-is-active" title="Opportunities" role="presentation">With Badges
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
<div class="slds-vertical-tabs">
<ul class="slds-vertical-tabs__nav" role="tablist" aria-orientation="vertical">
<li class="slds-vertical-tabs__nav-item slds-is-active" title="Opportunities" role="presentation">Modifiers
Interactions
Item Focus
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
<div class="slds-vertical-tabs">
<ul class="slds-vertical-tabs__nav" role="tablist" aria-orientation="vertical">
<li class="slds-vertical-tabs__nav-item slds-has-focus" title="Tab 1" role="presentation">Item Active
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
Tab Title
Content for Tab 1
Lorem ipsum dolor...
Lorem ipsum dolor...
<div class="slds-vertical-tabs">
<ul class="slds-vertical-tabs__nav" role="tablist" aria-orientation="vertical">
<li class="slds-vertical-tabs__nav-item slds-is-active" title="Tab 1" role="presentation">