GC Design System Components
Home 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 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

Link
<gcds-link>

Also called: anchor, hyperlink, call to action.

A link is a navigational element that brings a person to a new page, website, file, or section on the current page.

Link component preview

A link is a navigational element that takes a person to a website or opens a source, like a pdf.

Provide information for download files

  • Provide information in the link text about the file type and size of files for download: <gcds-link href="application.pdf" download>Application 2023 (PDF, 1.5 MB)</gcds-link>.
  • Avoid placing the download link within paragraph text.

Note: Only files with URLs of the same origin as the website will be downloaded to the user’s device.

  • A skip-to-content link lets a person skip a cluster of navigation links and jump to the main content.
  • To avoid covering up content, configure the link to push down content so it’s not floating, For desktop, place skip-to-content link at top left of the page so it doesn’t interrupt the flow.
  • Add an external link by setting the external attribute to true.
  • Avoid adding external links:
    • In the middle of a person’s progress, like when a person’s filling out a form.
    • If changing pages would make them lose unsaved progress.
    • When starting a process would stop if the person follows a link, like when they’re watching a video or completing a main task.
    • When they’re invasive and disruptive to the flow of the page.
    • When it could be a surprise for a person to find themselves somewhere else unexpectedly.
  • Make it obvious where a link will lead, so a person can decide if they should leave the current page.
  • Communicate clearly when links have special conditions. For example, when they’re only available inside a closed network because of a firewall.

Get your code

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
2024-02-21