Tabs
Tabs allows you to navigate between multiple documents in a single window. Instead of a single title bar, a tabbed window may include multiple tabs along the top. Clicking one of the tabs will display the contents of the corresponding document.
Standard Tabs
CSS Classes:
1. .tabs
- The parent element which wraps the tab navigation.
2. .tab
- The individual clickable tabs. The active tab will have the
.is-active
state class. - Must be assigned to
li
, the childa.tab-title
should have the[href]
set to the ID of the tab's content.
3. .tabs-contents
- The parent element which wraps the tab component's contents.
4. .tab-content
- The individual panel which corresponds to each tab.
- This should contain
.is-active
, and an ID for the tab to link to.
Headings can be set via the heading
attribute or the tab-heading
element in side the tab.
active
sets the currently active tab.
select
allows for an optional expression to be called when the tab is selected.
Accessibility
-
The
ul.tabs
should contain therole="tablist"
-
The
a.tab-title
should contain therole="tab"
, and be wrapped in ali.tab
with therole="presentation"
. It should also have anaria-controls
attribute which is the id of its tabpanel. -
If a tab is selected, the
role="tab"
should havearia-selected="true"
andtabindex="0"
, otherwise it should bearia-selected="false"
withtabindex="-1"
. -
Each
div.tab-content
should haverole="tabpanel"
, and should have anaria-labelledby
attribute which is the id of its correspondingrole="tab"
.