diff --git a/examples/tabs/tabs-1/tabs.html b/examples/tabs/tabs-1/tabs.html index 3ed2d23484..e1b3fe2401 100644 --- a/examples/tabs/tabs-1/tabs.html +++ b/examples/tabs/tabs-1/tabs.html @@ -7,48 +7,57 @@ + + +

Tabs With Automatic Activation

+

+ Provide feedback on updates to this page in + issue 278. +

This example section demonstrates a tabs widget that implements the design pattern for tabs. - In this example panels are automatically activated when its tab receives focus. + In this example, a tab is automatically activated and its associated panel is displayed when the tab receives focus. + Tabs should only be automatically activated in circumstances where panels can be displayed instantly, i.e., all panel content is present in the DOM. + For additional guidance, see Deciding When to Make Selection Automatically Follow Focus.

Similar examples include:

- +

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.

-
+
+

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.

+
- + - +
+
-

ARIA Roles, Properties, and States

- +

Role, Property, State, and Tabindex Attributes

- - - - + + + + - + + + + + + + + + + + + + + + + + + + - + + + + + + + - + + + + + + + + + + + + + - - + + @@ -159,7 +293,6 @@

ARIA Roles, Properties, and States

Javascript and CSS Source Code

-
  • CSS: tabs.css
  • Javascript: tabs.js
  • @@ -168,12 +301,9 @@

    Javascript and CSS Source Code

    HTML Source Code

    -
    - + +
    + + +
RoleProperty/StateElementUsageRoleAttributeElementUsage
tablist + tablist + + div + Indicates that the element serves as a container for a set of tabs.
+ aria-label=Entertainment + + div + Provides a label that describes the purpose of the set of tabs.
+ tab + + button + +
    +
  • Indicates the element serves as a tab control.
  • +
  • + When focused, is automatically activated, causing its associated tabpanel + to be displayed. +
  • +
  • + Provides a title for its associated tabpanel. +
  • +
+
+ aria-selected=true + + button +
    -
  • Serves as the container for the set of tabs.
  • +
  • Indicates the tab control is activated and its associated panel is displayed.
  • +
  • Set when a tab receives focus.
tab + aria-selected=false + + button + +
    +
  • + Indicates the tab control is not active and its associated panel is NOT + displayed. +
  • +
  • Set for all tab elements in the tab set except the focused tab.
  • +
+
+ tabindex=-1 + + button +
    -
  • Contains title for tab panel, activates tab panel when activated.
  • +
  • Removes the element from the page Tab sequence.
  • +
  • Set when a tab is not selected so that only the selected tab is in the page Tab sequence.
  • +
  • Since an HTML button element is used for the tab, it is not necessary to set tabindex=0 on the selected (active) tab element.
  • +
  • This approach to managing focus is described in the section on roving tabindex.
tabpanel + aria-controls=IDREF + + button + + Refers to the tabpanel element associated with the tab. +
+ tabpanel + + div + +
    +
  • Indicates the element serves as a container for tab panel content.
  • +
  • + Is hidden unless its associated tab control is activated. +
  • +
+
+ aria-labelledby=IDREF + + div +
    -
  • Contains the tab’s associated content.
  • +
  • + Refers to the tab element that controls the panel. +
  • +
  • Provides an accessible name for the tab panel.
aria-controlselement with role of tab + tabindex=0 + + div +
    -
  • +
  • Puts the tabpanel in the page Tab sequence.
  • +
  • Facilitates movement to panel content for assistive technology users.
  • +
  • Especially helpful if there are panels that do not contain a focusable element.