Accessibility
Bitwarden strives to comply with WCAG AA requirements. The following serves as an introduction to common aspects of accessibility that should be considered while implementing features and content. This list is not comprehensive, but provides a starting point for common “gotchas” that can limit the accessibility of a new feature. For comprehensive guidelines on accessibility, visit the official WCAG site.
Visual presentation
| WCAG Success Criteria | Description | 
|---|---|
| 1.4.3 Contrast minimum 1.4.11 Non-text contrast | Content should have contrast meeting or exceeding the WCAG AA guidelines: - For normal text: 4.5:1 - For large text and graphics: 3:1 - Use the WebAIM contrast checker to learn more. - When using variables from the Component Library, the text-mainvariable is tested onbackgroundandbackground-altvariables. All other backgrounds generally usetext-contrast. | 
| 1.4.13 Content on Hover of focus | Bitwarden design best practice: Interactive elements should always be visible without a user needing to hover or focus that element. This allows content to be more discoverable and thus accessible to users, while also eliminating the complexity necessary to implement such a pattern to meet WCAG criteria. | 
| 2.4.7 Focus visible | Bitwarden design best practice: All interactive elements should have visible focus, hover states, and the correct cursor styling. | 
| Bitwarden design best practice: Icons and text that is shortened should always have a titleattribute to provide additional context. | 
Keyboard navigation
| WCAG Success Criteria | Description | 
|---|---|
| 2.1.1 Keyboard | All mouse interactive elements on a page should be accessible via keyboard navigation. | 
| 2.1.1 Keyboard 2.1.2 No keyboard trap | If a popup (especially in the case of multiple dialogs) is opened, be sure to test that focus is moving to and from each dialog correctly and there is no keyboard trap. | 
| 2.4.7 Focus visible | Each interactive element should have a visible focus indicator to assist user navigating the page by keyboard. | 
Screen reader
Users with low vision or blindness will often navigate products using keyboard navigation and a screen reader. This results in an audio read out of the page’s content, often with additional instruction depending on what semantic element is in focus.
To understand more about screen reader and keyboard navigation, turn on VoiceOver on macOS or download NVDA on Windows and try navigating your device with keyboard and screen reader.
| WCAG Success Criteria | Description | 
|---|---|
| 1.1 Text alternatives | Include alt-textor aria-labels for any non-text elements that conveys information not provided elsewhere. If elements are not informative, they may be marked asdecorative. | 
| 1.3.1 Info and relationships 1.3.2 Meaningful sequence 3.3.1 Error identification 3.3.2 Labels or instructions | Be sure that related content is presented together and can be programmatically determined. Use aria-describedbyto associate content from one element with another. This is often used for form errors or helper text. | 
| 4.1.2 Name, role, value | Use aria-haspopupon elements that trigger another element like a menu or dialog. This tells a screen reader (and thus the user) that another element is opening that will have additional actions. See aria-haspopup - Accessibility MDN for more information. | 
| 4.1.2 Name, role, value | Use aria-expandedon elements that expand or collapse to show or hide more information. Note: botharia-haspopupandaria-expandedshould not be used on the same element. Default toaria-haspopupfor menus and usearia-expandedfor interactions like accordions or other show/hide toggles. | 
| 4.1.2 Name, role, value | Use aria-selectedwhen there are multiple elements that can be selected or unselected such as tabs, table rows, or grid cells. See more in aria-selected - Accessibility MDN. | 
| 4.1.2 Name, role, value | Most html elements have roles already assigned to them. However in some instances you may need to specify the role of an element. See WAI-ARIA Roles - Accessibility MDN for more information on roles. Most Bitwarden Component Library components already have applicable roles applied. But there may be cases where you need to build a new component where you should consider the element’s role. | 
| 4.1.3 Status messages | Sometimes an interaction on a page will trigger additional content being added or change. Example: clicking a button that says “Send verification code” triggers a confirmation message. It is important that this content is announced via the screen reader. This can be done via an aria-liveregion or using arole=alertattribute. | 
Semantic structure
Be sure to use proper semantic structure on each page. The elements used to create a page provide screen readers with more context in what type of content that element contains. The proper use of landmarks and headings, also allows users to navigate pages by just landmarks or heading levels, rather than having to always tab through the full page’s content.
| WCAG Success Criteria | Description | 
|---|---|
| 3.1.1 Language of page | Include a langattribute on thehtmlelement of each page. | 
| 2.4.2 Page titled | Use a titleelement and a singleh1to display the title on each page. | 
| 1.3.1 Info and relationships | Wrap content in the elements that have semantic meaning that matches the content’s purpose. Note: divandspanhave no semantic meaning so its best to avoid using them to wrap text. Instead use apelement. | 
| 1.3.1 Info and relationships | Use logical sequence for heading levels. A h4should not come before the firsth3element. In addition don’t skip heading levels, use the next descending header to create structure. | 
| 1.3.1 Info and relationships | Use landmark regions to communicate what content can be expected; be sure to include a navelement around the page’s navigation andmainaround the content of the page. | 
| 1.3.1 Info and relationships | Use aelements withhrefsfor links; use a link when the user is navigating to a new page. | 
| 1.3.1 Info and relationships | Use buttonelements to submit data or perform on-screen actions that do not move keyboard focus. | 
| 3.3.2 Labels or instructions | Use proper form semantics every input having a corresponding labelelement, andfieldsetwhen applicable. |