Skip to content
ShannonTucker edited this page Feb 7, 2022 · 23 revisions

Cards present a short summary of a much larger and more complex topic within an interactive container. Clicking on a card takes you to a new page that provides the full details on the topic.

Overview

There are 2 types of cards for both desktop and mobile.

1. Cards that contain a title link

  • The entire card is clickable
  • There is still the option of adding 1 or 2 action links that would be clickable as well and link to separate pages than that of the main card
  • The recommended card option, as the greater tap target increases accessibility

Desktop card

type title link

Mobile card

property title link

2. Cards that do not contain a title link

  • The entire card is NOT clickable; only the action link(s) are
  • There is a divider included in this version to better separate the content – remove the divider if you are keeping the image section in the card, as both are not needed

Desktop card

type no title link

Mobile card

property no title link

Usage

When to use

  • To present a summary and link to additional details and information
  • When you have multiples of the same content – an individual card is typically a member of a collection of similar cards, not a single card in isolation.

When NOT to use

  • When you need to emphasize the order of the content (tables organize and order content better)
  • When you have more than two action links
  • When you have inline links (i.e., links within description text)
  • For the sole purpose of styling a single block of content

How to use

  • Each card should only relate to one concept/idea
  • For cards that contain a title link, you must include at the minimum the title and the description section
  • For cards that do not contain a title link, you must include at the minimum the title, the description section, and 1 action link
  • Card titles should be a maximum of 40 characters long
  • Card descriptions should be short (2-3 sentences) as it is meant to be a summary of information

Customizing cards

Content/sections

  • The card content can be customized to your needs by removing sections that are not needed (e.g., if you don't need a label, remove the label layer in the component)
  • For cards with no title link, use either the divider line or an image/illustration, not both

Card width

  • Card width can be customized to your needs by dragging the component in or out to increase or decrease the width
    • Ensure you are using the grid system to size your cards
    • Use a maximum of 3 cards per row for desktop designs
    • See the below examples for more information

Colours

  • The colours used in the card component should not be changed

Labels

  • When adding a label with a long character count, ensure you have at least 24px of white space between the left side of the label and the left edge of the card by breaking the text into 2 lines.

Examples

These examples use real content from Service Canada and DECD to show variations of how cards can be used within our grid system.

Desktop – Cards with title link

Cards with title link

Desktop – Cards with regular title (no title link)

card with regular link

Mobile – Cards with title link

mobile card with title link

Mobile – Cards with regular title (no title link)

mobile cards with regular link

Accessibility

When developing a page that uses cards, update the heading level based on the content of your page to make sure card headings are in the correct order. For more information on Headings, view the typography section.

How we created this component - 4A Assessment

We added the cards component to the Extended GC Design library - DECD as it did not exist in the Canada.ca design system. We started with the Context-specific features pattern from the Canada.ca design system, which is the only card-type component. Based on our teams needs, we added in relevant sections to the card component as needed.

Clone this wiki locally