Skip to main content

Card

Library
Allium Design Systemweb-only
Repository
github.com/telus/allium-design-system
Package
npmjs.com/package/@telus-uds/ds-allium
Package version
1.14.0
Loading...

Introduction

import { Card } from '@telus-uds/ds-allium'

Cards are content containers with varying styles and predetermined padding.

Guidance

  • 2 different backgrounds: default, alternative
  • 5 different padding options
    • 3 predetermined, responsive padding (default, narrow, intermediate)
    • 1 predetermined, applies to all viewports (compact)
    • 1 custom
  • With/without footer
    • Footer will maintain variant’s padding by default, but it can be overridden via a dedicated footerPadding prop accepting an object with the following padding tokens:
      • paddingBottom
      • paddingLeft
      • paddingRight
      • paddingTop
  • With/without a full bleed image
    • In cases where a full bleed image is desired, use the fullBleedContent property of the Card component.
    • If passing a fullBleedContent property, use the src (or multiple sources for ResponsiveImage, or a custom fullBleedContent), alt tag, and position prop to control the image appearance.
    • Position can be passed as one of the following words: 'left', 'right', 'top', or 'bottom', depending on where in the Card you would like the image to be
    • If the image won't always fill the available space, its alignment may be set with an align prop of 'start', 'center' or 'end'

Accessibility

No accessibility notes.

Platform considerations

This component is currently only supported on web.

A basic Card with Allium theming is available for native apps from @telus-uds/components-base. This one only takes the theming props, tokens and variant, and only applies Card-like styling. The additional features documented here (e.g. full bleed content) are built on top of that base Card and oriented to web design patterns; native app projects may use the base Card to build their own Card components in a similar way, oriented around project-relevant app design patterns.

Figma

Props

NameTypeDefaultDescription
childrennodeCard content.
footernodeCard footer.
footerPaddingpaddingPropCustom card footer padding.
fullBleedContent{ position, align }Full bleed content to be placed on the card.
fullBleedImage{ position, align }Full bleed image to be placed on the card, deprecated in favor of 'fullBleedContent'. @deprecated
tokenscustomSystem tokens prop, see tokens for more details
variantvariantPropSystem variant prop, see variants for more details

Variants

Alternative background

Loading...
Loading...
Loading...

With full bleed image

Responsive positioning is supported.

Loading...

A footer can also be used with a full bleed image.

Loading...

You can also render any content full bleed-style by passing some JSX to the content field of the fullBleedContent prop:

Loading...

Groups of Card components

Multiple Card components may be laid out in a stacking component to give users a selection of articles.

This is an example of three Cards in a responsive StackView that flips from horizontal to vertical based on viewport:

import { Card, StackView } from '@telus-uds/ds-allium'
Loading...

Feedback