-
Notifications
You must be signed in to change notification settings - Fork 793
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add accessibility tab to popover component (#4209)
* add a11y tab * add a11y to tab code * add images * update list formatting * update caption length * update a11y.mdx * edit captions * fix typo
- Loading branch information
1 parent
82d8bff
commit d7fb041
Showing
6 changed files
with
83 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
title: Popover | ||
description: | ||
No accessibility annotations are needed for popover, but keep these | ||
considerations in mind if you are modifying Carbon or creating a custom | ||
component. | ||
tabs: ['Usage', 'Style', 'Code', 'Accessibility'] | ||
--- | ||
|
||
import A11yStatus from 'components/A11yStatus'; | ||
|
||
import { Popover } from '@carbon/react'; | ||
|
||
<PageDescription> | ||
|
||
No accessibility annotations are needed for popover, but keep these | ||
considerations in mind if you are modifying Carbon or creating a custom | ||
component. | ||
|
||
</PageDescription> | ||
|
||
<AnchorLinks> | ||
<AnchorLink>What Carbon provides</AnchorLink> | ||
<AnchorLink>Development considerations</AnchorLink> | ||
</AnchorLinks> | ||
|
||
<A11yStatus layout="table" components="Popover" /> | ||
|
||
## What Carbon provides | ||
|
||
Carbon bakes keyboard operation into its components, improving the experience of | ||
blind users and others who operate via the keyboard. Carbon incorporates many | ||
other accessibility considerations, some of which are described below. | ||
|
||
### Keyboard interactions | ||
|
||
Popovers use an icon button for the trigger. These buttons are in the tab order | ||
and are activated by pressing `Enter` or `Space`. The activation toggles the | ||
popover open and closed, and focus remains on the trigger. | ||
|
||
When the popover contains interactive elements, pressing `Tab` will move focus | ||
to the first component in the popover. When the popover only has non-interactive | ||
text, or when the focus is on the last component in the popover, pressing `Tab` | ||
will close the popover and move focus to the next tab stop on the page. | ||
|
||
<Row> | ||
<Column colLg={12}> | ||
|
||
![The icon button trigger and interactive elements inside of the popover are in the page tab order.](images/popover-a11y-1.png) | ||
|
||
<Caption> | ||
The icon button trigger and interactive elements inside of the popover are in | ||
the page tab order. | ||
</Caption> | ||
|
||
</Column> | ||
</Row> | ||
|
||
<Row> | ||
<Column colLg={12}> | ||
|
||
![Use Space or Enter to open and close the popover, and use Esc or Tab on the last component to dismiss it.](images/popover-a11y-2.png) | ||
|
||
<Caption> | ||
Use Space or Enter to open and close the popover, and use Esc or Tab on the | ||
last component to dismiss it. | ||
</Caption> | ||
|
||
</Column> | ||
</Row> | ||
|
||
## Development considerations | ||
|
||
Keep these considerations in mind if you are modifying Carbon or creating a | ||
custom component. | ||
|
||
- The icon button has an `aria-label` that defines or describes what the icon | ||
is. | ||
- The button uses `aria-expanded` to set popover visibility and `aria-controls` | ||
to handle navigation to the content. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters