Screenreader-only
<gcds-sr-only>
Also called: visually hidden, assistive text.
The screenreader-only component is text information only accessible with assistive technologies.
-
GitHub -
Figma
Screenreader-only component preview
Build a screenreader-only
Use screenreader-only for assistive technology-specific text content that communicates information solely available by visual means.
Coding and Accessibility for screenreader-only
Write helpful screenreader-only content
Flag contextual information exclusively communicated through visual styling that's absent from ‌semantic HTML.
Keep screenreader-only content clear and very brief. Adding too much text unnecessarily increases the cognitive load.
Provide additional text content for assistive technologies only when the interface design relies on visual information to communicate.
Avoid including additional information that's unavailable in the interface.
Avoid duplicating any information included in descriptive text (alt-text). If the descriptive text already provides the context, the screenreader-only component may not be needed.
Provide an equitable experience in both Official Languages
Use the screenreader-only content to make sure the text will be read in the language associated with the component's language tag.
Avoid using an
aria-label
attribute to set another language because some assistive technologies will default to page's source language.
Get your code
Generate an instance of the component you need by selecting its code properties.
-
Explore by choosing different code values to generate the instance you want.
-
Get the code and pull it into your environment.
-
Add any copy you need to the component (like text for a label).
Note: Following standard practice, the code builder uses English for all code elements.
Help us improve
Have questions? Something you'd change or you'd like to see? Share your feedback with us to help improve GC Design System.