Home
Sample content section. Activating a link above will update and navigate to this region.
Although this example uses the word "menu" in the colloquial sense to refer to a set of navigation links, it does not use the WAI-ARIA menu role. That is because the menu and menubar roles require complex functionality, such as composite widget focus management and first-character navigation, that is unnecessary for typical site navigation.
The following example demonstrates using the disclosure design pattern to show and hide dropdown lists of links in a navigation bar for a mythical university web site. Unlike the other disclosure navigation menu example, this example includes top-level links alongside the disclosure buttons.
Similar examples include:
This example demonstrates two different ways of implementing keyboard support. Toggle between them with the following checkbox.
Sample content section. Activating a link above will update and navigate to this region.
Mythical University.
grid
, that is expected to occupy only one stop in the page Tab sequence and manage focus for all its descendants.
Key | Function |
---|---|
Tab Shift + Tab |
Move keyboard focus among top-level links and buttons, and if a dropdown is open, through links in the dropdown. |
Space or Enter |
|
Escape | If a dropdown is open, closes it and sets focus on the button that controls that dropdown. |
Down Arrow or Right Arrow (Optional) |
|
Up Arrow or Left Arrow (Optional) |
|
Home (Optional) |
|
End (Optional) |
|
Role | Attribute | Element | Usage |
---|---|---|---|
aria-controls="IDREF"
|
button
|
Indicates that the disclosure button controls visibility of the container identified by the IDREF value.
|
|
aria-expanded="false"
|
button
|
|
|
aria-expanded="true"
|
button
|
|
|
aria-current="page"
|
a
|
Indicates that the page referenced by the link is currently displayed. |