Card

Install the component dependency:

Include a React component in your project:

Card PropTypes

NameValueDescriptionDefault
actionBarCard.Action[]top-right action buttons
actionBarVisiblebooleanlock action bar onfalse
bonusBarReact elementfreeform space in image bottom-left
fullOverlayCard.FullOverlayLinkhover state for image
fullOverlayVisiblebooleanlock full overlay onfalse
image
Required
Card.Image |Card.ImageLink > a > Card.Imagemain image or linked image
metadata1string[] | React element[]first row of metadata
metadata2string[] | React element[]second row of metadata
progressnumberprogress 0-100
sizesmall | medium | largesize of card (from Card.sizes)medium
tagCard.Tagcategorization label in top-left
title
Required
Card.TextLink > a > Card.Title | Card.Titlecard title or linked title

Card.Action PropTypes

icon
Required
Iconicon representing action

Card.Image PropTypes

src
Required
stringimage url

Card.Tag PropTypes

iconIcontag icon

The card is a flexible component that will fit the container it's given. A carousel is a common container layout that one might encounter in the product. This is an example implementation of how the Card might look in a carousel in your app, using the Layout.EqualColumnLayout component.

While the component is flexible, the size will determine certain base proportions and flexibility min and max bounds.

The image will cover the space given. This space is variable width but set height according to the `size` property.

Progress, if given, should be a number between 0 and 100 that describes the completion level of the content represented on the card.

The title can be a string or a some other element, such as a link, that contains a string

Strings are line-clamped to 2 lines max, then the text will overflow with an ellipsis appended.

Metadata is free-form strings or displayable elements like links. Each bit of metadata is separated by an interpunct.

Metadata is constrained to a single line, overflowing with an ellipsis indicated. The first datum is given display space precendence.

The action bar contains the on-card affordances a user can take besides linking straight to the content. These are usually buttons.

The tag provides a label, usually categorizing the card's content.

A special main action representing the main interaction for the card can be provided here. It will appear overlaid in the center of the image.

Some cards may make use of a freeform area of content overlaid in the bottom-left corner of the image area. Use with dignity.