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
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
- 3 predetermined, responsive padding (default,
- 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
- Footer will maintain variant’s padding by default, but it can be overridden via a dedicated
- 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 thesrc
(or multiple sources forResponsiveImage
, or a customfullBleedContent
),alt
tag, andposition
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'
- In cases where a full bleed image is desired, use the
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
Name | Type | Default | Description |
---|---|---|---|
children | node | Card content. | |
footer | node | Card footer. | |
footerPadding | paddingProp | Custom 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 | |
tokens | custom | System tokens prop, see tokens for more details | |
variant | variantProp | System variant prop, see variants for more details |
Variants
Alternative background
With footer
With footer and custom padding
With full bleed image
Responsive positioning is supported.
A footer can also be used with a full bleed image.
You can also render any content full bleed-style by passing some JSX to the content
field of the fullBleedContent
prop:
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 Card
s in a responsive StackView
that flips from horizontal to vertical based on viewport:
import { Card, StackView } from '@telus-uds/ds-allium'
Feedback
- Spotted a problem with this component? Raise an issue on GitHub
- See any existing issues for this component
- Contact the team on slack in #ds-allium-support