Tabs

The below example section demonstrates a tabs widget that implements the design pattern for tabs.

Example

Nils Frahm is a German musician, composer and record producer based in Berlin. He is known for combining classical and electronic music and for an unconventional approach to the piano in which he mixes a grand piano, upright piano, Roland Juno-60, Rhodes piano, drum machine, and Moog Taurus.

Keyboard Support

Key Function
tab Moves focus to the active tab or first focusable in the tab panel.
left arrow Moves focus to the previous tab.
right arrow Moves focus to the next tab.
home Moves focus to the first tab.
end Moves focus to the last tab.
delete If deletion on the selected tab is allowed this will that tab element and its associated tab panel.

ARIA Roles, Properties, and States

Role Property/State Element Usage
tablist
  • Serves as the container for the set of tabs.
tab
  • Contains title for tab panel, activates tab panel when activated.
tabpanel
  • Contains the tab’s associated content.
aria-controls element with role of tab

Javascript and CSS Source Code

HTML Source Code