GC Design System Components
GC Design System Start to use Page templates overview Basic page Components overview Breadcrumbs Button Card Checkboxes Container Date input Date modified Details Error message Error summary Fieldset File uploader Footer Grid Header Heading Icon Input Language toggle Link Notice Pagination Radios Screenreader-only Search Select Side navigation Signature Stepper Table Text Textarea Theme and topic menu Top navigation CSS shortcuts overview Reset styles Responsive layout State Box sizing Container sizing Display Overflow Position Visibility Font Font family Font size Font style Font weight Line height Link colour Link size Link text decoration List style Text align Text colour Text overflow Text transform Word break Margin Padding Align content Align items Align self Flex Flex direction Flex grow Flex shrink Flex wrap Gap Grid columns Grid rows Justify content Justify items Justify self Order Place content Place items Place self Background colour Border colour Border radius Border style Border width Icon names Icon size Image Cursor Pointer events Transition Styles overview Design tokens Colour tokens Spacing tokens Typography tokens Contact us Get involved Find a demo

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.

Text component preview

On this page

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-limit attribute to false.

Set the text size

  • Set the text size attribute to body or small.
  • Use the default body size value to render a p element with the recommended font size and colour contrast.
  • Opt to display smaller text by setting the size attribute to small to render a small element inside a p element.

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 strong tag within the gcds-text component 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 em tag within the gcds-text component to emphasize specific words or phrases.
  • Use the HTML code element within the gcds-text component to wrap content that represents code. The code element is styled with the monospace typography token.

Examples Explore the different ways you can configure the component. Each example shows a working implementation and ready-to-copy code.

In this section

Optional attributes These attributes allow you to customize or extend the component’s behaviour and presentation.

character-limit

The character-limit attribute sets the line length to a maximum amount of characters per line to ensure a comfortable, accessible reading length.

<gcds-text character-limit="false">
  This is text that's related to the heading and describes in further detail the heading's subject or action. Text is typically one or several lines or paragraphs that form a section's content or introduce a bulleted list, table, or other content, like an image or video.
</gcds-text>

display

The display attribute sets the display behaviour of the text. The available options are:

  • block (default)
  • flex
  • inline
  • inline-block
  • inline-flex
  • none

<gcds-text display="flex">
  This is text that's related to the heading and describes in further detail the heading's subject or action. Text is typically one or several lines or paragraphs that form a section's content or introduce a bulleted list, table, or other content, like an image or video.
</gcds-text>

margin-bottom

The margin-bottom attribute sets a margin below the text. The default margin-bottom is 300.

<gcds-text margin-bottom="600">
  This is text that's related to the heading and describes in further detail the heading's subject or action. Text is typically one or several lines or paragraphs that form a section's content or introduce a bulleted list, table, or other content, like an image or video.
</gcds-text>

margin-top

The margin-top attribute sets a margin above the text. The default margin-top is 0.

<gcds-text margin-top="600">
  This is text that's related to the heading and describes in further detail the heading's subject or action. Text is typically one or several lines or paragraphs that form a section's content or introduce a bulleted list, table, or other content, like an image or video.
</gcds-text>

size

The size attribute sets the text size. The available options are:

  • body (default)
  • small

<gcds-text size="small">
  This is text that's related to the heading and describes in further detail the heading's subject or action. Text is typically one or several lines or paragraphs that form a section's content or introduce a bulleted list, table, or other content, like an image or video.
</gcds-text>

text-role

The text-role attribute sets the main style of the text. The available options are:

  • primary (default)
  • secondary
  • light

<gcds-text text-role="secondary">
  This is text that's related to the heading and describes in further detail the heading's subject or action. Text is typically one or several lines or paragraphs that form a section's content or introduce a bulleted list, table, or other content, like an image or video.
</gcds-text>

Slots The default slot allows you to inject custom content into the component’s primary content area, and named slots, into specific areas.

default

The default slot is for placing the content of the text element.

<gcds-text>
  This is text that's related to the heading and describes in further detail the heading's subject or action. Text is typically one or several lines or paragraphs that form a section's content or introduce a bulleted list, table, or other content, like an image or video.
</gcds-text>

Code builder

Generate an instance of the component you need by selecting its code properties.

  1. Explore by choosing different code values to generate the instance you want.

  2. Get the code and pull it into your environment.

  3. 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 account. You'll have access to the team's direct responses, progress made on your issue, and issues raised by others.

Give feedback Report an issue on GitHub
2026-08-24