This page provides accessibility guidance, and is not a catch-all for all web accessibility situations. Seek out additional resources and/or consult with accessibility professionals to ensure web accessibility standards are met and best practices are implemented
Calcite Components leverage the W3C Accessibility Standards to ensure the applications and experiences you create are usable by a wide range of audiences.
While Calcite Design System is created with accessibility in mind, there are additional steps you can take to ensure a diverse audience can navigate, understand, and use the solutions you build.
Designing for individuals
A product of the W3C Accessibility Standards are the Web Content Accessibility Guidelines (WCAG), an internationally agreed upon set of guidelines established to ensure web experiences are usable by a wide range of audiences. Some considerations in designing for individuals include:
On the autism spectrum
Do use simple sentences and bullets.
Avoid creating a wall of text.
Who use screen readers
Do write descriptive links and headings.
Avoid writing vague links and headings.
Who have low vision
Do use a combination of color, shapes, and text.
Avoid using only color to convey meaning or status.
With physical or motor difficulties
Do make large clickable actions.
Avoid demanding precision.
Who are deaf or hard of hearing
Do use subtitles or provide transcripts for video.
Avoid placing content in audio or video formats only.
With dyslexia
Do provide reminders and prompts.
Avoid forcing people to remember things from previous actions and/or places.
Color
Avoid relying on color alone to communicate information, which can create barriers for colorblind and low vision users. To ensure your content can be interpreted by a larger audience it is recommended to:
Use a combination of color, shapes, patterns, and text to provide additional visual cues
Provide a text alternative for complex maps, charts, and graphics
Consider color as a means to enhance your content. Color is an element of visual communication, which supports design, identity, and usability.
For instance, to relay context of an invalid user entered value in Input, use color and an accompanying Input Message.
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<calcite-labelid="labelStatus"for="inputEl"class="error"> Favorite animal
</calcite-label><calcite-inputid="inputEl"aria-labelledby="invalidMsg"status="invalid"placeholder="Enter an animal name"value="ca"></calcite-input><calcite-input-messageid="invalidMsg"aria-live="polite"icon="exclamation-mark-triangle"scale="l"status="invalid"> Animal name must contain at least 3 characters. Current value is 2 characters.
</calcite-input-message>
The page's reading order should have a logical structure. To check the reading order, follow the focus commands using the Tab key to step forward and the Shift and Tab keys to step back. The order should have the same flow as displayed visually, particularly with forms and search dialogs.
Content on the page should be clear and concise using plain language, without any use of jargon or undefined acronyms. Line length, either too short or too long, can be confusing to both sighted and non-sighted users. Ensure text content is straightforward, yet distinguishable.
Language
You must set a language on your application so users can read and interpret the content. Setting the language is vital for assistive technologies to access the page contents.
Set the language on the html tag so it can be interpreted throughout the application. If additional languages are needed throughout the page, you can define them as needed, and in some cases, on individual components.
Use dark colors for code blocksCopy
1
<htmllang="en">
Headings
To facilitate navigation and understanding of overall document structure, use heading elements that are properly ordered or nested (h1, h2, h3, h4, h5, and h6). Heading elements allow user agents to automatically identify section headings.
For example, if the page includes h1 and h2 tags, when designing a calcite-modal you could use a h2 or h3 tag in the modal's title:
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
<!-- If h1 and h2 tags are present, the calcite-modal header could use a h2 or h3 tag --><calcite-modalaria-labelledby="modal-title"><h3slot="header"id="modal-title">Modal title</h3><divslot="content">Modal content</div><calcite-buttonslot="secondary"width="full"appearance="outline">Cancel</calcite-button><calcite-buttonslot="primary"width="full">Save</calcite-button></calcite-modal>
In the same scenario, you should not assign a h4, or higher tag to the calcite-modal title, as the page would not have a designated h3 tag established. The skipped header makes it seem like the user has missed hidden content, which, in effect, creates a usability problem.
Keyboard Operability
Similar to heading elements, content should have the same functional and visual order using HTML. When adding multiple elements throughout the page, ensure the HTML matches with the intent.
For example, to ensure content residing in the calcite-switch is accessed by keyboard and visual users in the same hierarchy, the HTML should reflect the same order. First by declaring the calcite-label, next the calcite-switch, and finally the viewDiv.
Use dark colors for code blocksCopy
1
2
3
4
5
<calcite-labellayout="inline">Dark mode:
Off <calcite-switch></calcite-switch> On
</calcite-label><divid="viewDiv"></div>
Focus
Keyboard focus refers to the element receiving keyboard input. Exactly one element is able to have focus at a time. In most browsers, users can move focus by pressing the Tab key to step forward and the Shift and Tab keys to step back.
For an otherwise unfocusable element to become focusable, such as a div, it must contain a tabindex attribute. A page's focus order must preserve it's meaning and promote ease of use. Focus order should be logical, and generally follow the visual order of the page.
Note
Do not use tabindex greater than 0 to achieve focus order, doing so can create maintainability problems and unexpected user behavior.
Alternative text (Alt text)
When adding images to content, leverage alt text to provide a description to the image presented. Be succinct, while also descriptive, to provide context to non-visual users.
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
<calcite-card><spanslot="title">Grizzly bears</span><spanslot="subtitle">Alaska</span><imgsrc="grizzly-bear.png"alt="A grizzly bear captures a salmon mid-flight during Alaska's salmon run,
an annual return of millions of salmon from the ocean to mountain streams."><divslot="footer-start"><calcite-buttonicon-end="plus">Learn more about bears</calcite-button></div></calcite-card>
Forms and labels
When working with forms for readability and to support assistive technologies, you must add labels explicitly to associate text with form elements. Calcite has implemented calcite-label to add labels to form elements. For example:
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<form><fieldset><legend>Report a Monarch Butterfly Sighting</legend><calcite-label>What is your name?
<calcite-inputtype="text"placeholder="John Muir"></calcite-input></calcite-label><calcite-label>When did you encounter a Monarch Butterfly?
<calcite-input-date-pickerid="date-picker"></calcite-input-date-picker></calcite-label></fieldset></form>
Grouping form controls
Grouping within a form is important to provide context, so the form can be understood and submitted successfully.
The fieldset and legend elements provide grouping for a form control, and it's caption respectively. When designing control-based components in a form, such as calcite-radio-button-group, the fieldset and legend form control elements should accompany the component.
For design consistency, add Calcite Design System Colors and Typography to the form control elements. For instance:
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!-- Grouping and caption for calcite-radio-button-group with form control elements --><fieldset><legend>Have you ever encountered a Monarch Butterfly?</legend><calcite-radio-button-group><calcite-labellayout="inline"><calcite-radio-buttonvalue="yes"></calcite-radio-button>Yes
</calcite-label><calcite-labellayout="inline"><calcite-radio-buttonvalue="maybe"></calcite-radio-button>Maybe
</calcite-label><calcite-labellayout="inline"><calcite-radio-buttonvalue="no"></calcite-radio-button>Not yet
</calcite-label></calcite-radio-button-group></fieldset>
Your solutions should be inclusive, and accessible to as many people as possible. The checklist below helps identify potential accessibility issues to keep in mind while designing and developing with Calcite Design System.
Note
Completing the checklist does not guarantee the solutions you build are accessible. However, addressing issues from the checklist will improve the experience for a larger audience.
Content
Information should not depend on color, sound, shape, size, or visual locationText and background color should have sufficient contrastLinks should be descriptive and provide intentUse descriptive section headingsForms contain descriptive labelsForms have helpful error and verification messagesLabels accompany their associated form fieldsContent does not lose context when zoomed or enlargedSite should not time out unexpectedlyContent is understandable with no styles enabledWeb page size should not exceed 500k
Keyboard and assistive technology
Support keyboard navigationAvoid mouse only interactionsFocus states should be visible for keyboard usersAllow keyboard users to skip navigationUsers should be able to navigate content using a screen reader
Multimedia and data visualization
Images should have meaningful alternative text, or be intentionally marked as decorativeDecorative images should not be read to screen readersMultimedia should have alternative ways to be consumedTable data can be accessed by non-sighted usersMake data available for graphs, charts, maps, SVGs, etc. through assistive technologyContent that moves automatically has the ability to be pausedLimit or remove any flashing elementsEnsure audio and video is not played automatically