Simple example of hiding and showing regions using aria-expanded. aria-controls is used to maintain markup associations.
Tab: Move between triggers. Enter or space: Toggle display of hide/show regions.
A tabbed interface component is a container for resources associated with a tab. It is a set of layered pages where only one page is displayed at a time. The general look is similar to a file folder with a "tab" that contains the title of the folder. The tabs are arranged along one of the edges of the contents but most commonly are found at the top of the page. The user navigates and makes the contents of each page visible by interacting with the title "tab" of the page. Sometimes referred to as a tab container or tab panel. Terms for understanding Tab Panels include:
When the user activates a tab, the contents of the corresponding tab panel is made visible. The tab is considered "active". The tab remains active until another tab is activated. The active tab is placed into the tab order. Only the active tab should be in the tab order. A default tab is specified that is active when the tabbed interface component is initialized. A collection of tabs and their associated tab panels is a complex widget, because it performs show/hide actions as well as moving the user's point of regard around within the content.
Regarding Control+PageUp/Control+PageDown. This is currently implemented in Firefox to move between browser tabs. Firefox also supports Control+Tab and Control+Shift+Tab to move between tabs. Internet Explorer 7 also uses Control+Tab and Control+Shift+Tab. There may be advantages to using Control+PageUp/Control+PageDown as the keys to change tabs since it is a recognizable keystroke to at least Firefox users and is also supported by the Windows operating system to move between panels in a tabbed dialog. The problem is that if the user is within a tabbed interface control on a Web page, they can not easily switch browser tabs without first moving focus outside of the tabbed interface control. This may be acceptable. The other issue is if the entire Web page is a tabbed interface control - in that case the user could not ever switch browser tabs unless the control on the Web page ignored the Control+PageUp/Control+PageDown keypress (and thus letting the browser access it) when the first or last tab was reached.
tabpanel
.tab
is used as a grouping label, providing a link for selecting the tabpanel to be rendered to the user.aria-controls
relationship of a tab to the ID of its tabpanel.aria-selected
state.tablist
is the container role for a set of elements with the role attribute set to tab
.An accordion component is a collection of expandable panels associated with a common outer container. Panels consist of a header and an associated content region or panel. The primary use of an Accordion is to present multiple sections of content on a single page without scrolling, where all of the sections are peers in the application or object hierarchy. The general look is similar to a tree where each root tree node is an expandable accordion header. The user navigates and makes the contents of each panel visible (or not) by interacting with the Accordion Header. Terms for understanding accordions include:
aria-expanded
state is 'true'), then focus moves to the first focusable element in the panel.
In Firefox, pressing Control+PageUp / Control+PageDown moves between browser tabs. Firefox also supports Control+Tab and Control+Shift+Tab to move between tabs. Internet Explorer 7 also uses Control+Tab and Control+Shift+Tab. There may be advantages to using Control+PageUp/PageDown as the keys to change tabs because it is a recognizable keystroke to at least Firefox users and it is also supported by the Windows operating system to move between panels in a tabbed dialog.
You should be aware of two issues with using Control+PageUp/PageDown:
tablist
and have aria-multiselectable
="true" This will enable an assistive technology, such as screen reader, to convey that the tablist is an accordion or a multiselectable tablist. This will also tell the user that the keyboard navigation matches an accordion and not a tablist.tab
.tabpanel
and should have an aria-labelledby
relationship referencing the correponding header having a role of tab
aria-expanded
state.aria-selected
state.aria-hidden
state.