Skip to main content

PreviewCard

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 { PreviewCard } from '@telus-uds/ds-allium'

A PreviewCard is a Card designed for guiding a user to an article based on the article's title and other details.

Guidance

  • Showcase and guide users to another page
  • Whole card is interactive
  • Width expands based on column or container
  • Height expands to the tallest PreviewCard in the row
  • You can render any content full bleed-style by passing some JSX to the content field of the fullBleedContent prop:
Loading...
caution

Note that at the moment Video component does not provide perfect experience when used within a clickable cards (PreviewCard, StoryCard) with href set: the volume and progress sliders can be clicked but are not draggable. As a workaround, one can use onPress prop instead href to organize navigation in such cases.

Feel free to follow https://github.com/telus/allium-design-system/issues/6 if you would like to be up to date on the state of this issue.

Accessibility

The entire card is focused as one unit, and screenreaders read the content of each card as one unit. Multiple cards will therefore be read as a list of semantic links.

Platform considerations

This component is currently only supported on web.

Figma

Props

NameTypeDefaultDescription
footernode | stringSection containing additional information, such as author and date. Use '<PreviewCard.AuthorDate author={...} date={...} />' here for author and date.
fullBleedContentFullBleedContent.propTypes || {}fullBleedImageFull bleed content to be placed on the card.
fullBleedImageFullBleedContent.propTypes || {}Full bleed image to be placed on the card, deprecated in favor of 'fullBleedContent'. @deprecated
hrefstringThe URL of the story to be navigated to. Note that 'Video' component does not play well when used within a 'PreviewCard' with 'href' prop set (the volume and progress sliders can be clicked but are not draggable). Please use 'onPress' prop instead 'href' to organize navigation in cases like this. @see https://github.com/telus/allium-design-system/issues/6
onPressfuncOptional function to be called on press e.g. for within-page navigation.
tagstringText stating the category of the content.
title*stringText stating the title or headline of the story.

Variants

This component does not have any stylistic variants.

It is similar to StoryCard, which has a slightly different layout and includes a description field for summarising article content.

The footer prop may contain any content. Many times, this will be author and date, and so a component PreviewCard.AuthorDate is provided to facilitate this.

Loading...

Groups of PreviewCard components

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

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

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

Feedback