GC Design SystemComponents
GC Design System Start to use Page templates overviewBasic page Components overviewAlertBreadcrumbsButtonCardCheckboxesContainerDate inputDate modifiedDetailsError messageError summaryFieldsetFile uploaderFooterGridHeaderHeadingIconInputLanguage toggleLinkNoticePaginationRadiosScreenreader-onlySearchSelectSide navigationSignatureStepperTableTextTextareaTheme and topic menuTop navigation CSS Shortcuts overview Reset styles Responsive layoutState Box sizingContainer sizingDisplayOverflowPositionVisibility FontFont familyFont sizeFont styleFont weightLine heightLink colourLink sizeLink text decorationList styleText alignText colourText overflowText transformWord break MarginPadding Align contentAlign itemsAlign selfFlexFlex directionFlex growFlex shrinkFlex wrapGapGrid columnsGrid rowsJustify contentJustify itemsJustify selfOrderPlace contentPlace itemsPlace self Background colourBorder colourBorder radiusBorder styleBorder width Icon namesIcon sizeImage CursorPointer eventsTransition Styles overviewDesign tokensColourSpacingTypography Contact usGet InvolvedFind 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.
  • 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.

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.

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-06-18