Text
<gcds-text>
Also called: text block, copy, caption, body text, paragraph.
Text is a styled and formatted paragraph that displays written content in an accessible way.
-
GitHub -
Figma
Text component preview
Build a text component
Text displays non-heading content with matching GC Design System styles to provide accessible text sizes and colour contrast.
Coding and accessibility for text
Ensure accessible character limits
- Maintain the default line length maximum of 65 characters for each line of text to ensure a comfortable, accessible reading length.
- Opt to shorten the line length by setting the
character-limitattribute tofalse.
Set the text size
- Set the text
sizeattribute tobodyorsmall. - Use the default
bodysizevalue to render apelement with the recommended font size and colour contrast. - Opt to display smaller text by setting the
sizeattribute tosmallto render asmallelement inside apelement.
Use text styling sparingly
- Only use underline for links.
- Use bold text sparingly.
- Avoid using bold text as a heading. Headings are the accessible component for identifying content sections.
- For bold text, use the
strongtag within thegcds-textcomponent to highlight terms and emphasize key points. - Only use italics for:
- Legal reference, like the Accessible Canada Act.
- Words in other languages, including Latin.
- Titles of publications, works of art, and mathematical and scientific material.
- Use the
emtag within thegcds-textcomponent to emphasize specific words or phrases.
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: The code builder uses English for all code elements, which follows standard practice.
Help us improve
Have questions or a request? Give feedback on our contact form.
Something's wrong? Raise it through GitHub with an