Skip to content

Cimpress UI exports several card-related components:

  • Card: container component that displays a card.
  • CardHeader: renders a card title with optional description, icon, and menu.
  • CardContent: renders a single content section within Card.
  • Divider: renders a line between card sections to visually separate them.
import { Card, CardContent, CardHeader, Divider } from '@cimpress-ui/react';

Card collections should be grouped in HTML lists.

Cards shouldn’t be miniature web pages. Avoid too much functionality, and reduce tab stops to a minimum to simplify keyboard navigation through the card list.

Groups related blocks of content into a single unit.

See card usage guidelines.

Ref<HTMLDivElement>

The ref type for this component.

CardProps
ReactNode

The contents of the card.

string

The element's unique identifier. See MDN.

boolean

Use this attribute to "claim" the component tree for exclusive Cimpress UI usage.

string

Sets the CSS className for the element. Only use as a last resort. Use style props instead.

See styling guide.

CSSProperties

Sets the CSS style for the element. Only use as a last resort. Use style props instead.

See styling guide.

StyleProps
Responsive<Spacing | "auto">

The amount of margin applied to all edges of this component.

Responsive<Spacing | "auto">

The amount of margin applied to the left and right edges of this component. Takes priority over margin.

Responsive<Spacing | "auto">

The amount of margin applied to the top and bottom edges of this component. Takes priority over margin.

Responsive<Spacing | "auto">

The amount of margin applied to the top edge of this component. Takes priority over marginY and margin.

Responsive<Spacing | "auto">

The amount of margin applied to the right edge of this component. Takes priority over marginX and margin.

Responsive<Spacing | "auto">

The amount of margin applied to the bottom edge of this component. Takes priority over marginY and margin.

Responsive<Spacing | "auto">

The amount of margin applied to the left edge of this component. Takes priority over marginX and margin.

Renders a header within a Card.

CardHeaderProps
ReactNode

The title of the card. Optionally, you can pass a React node to render a link.

Examples:
<CardHeader title="Card title" />
<CardHeader title={<Link href="#">Card title</Link>} />
ReactNode

The icon to display at the start of the header.

ReactNode

The description of the card. Optionally, you can pass a React node to render rich text.

Examples:
<CardHeader title="Card title" description="Card subtitle" />
<CardHeader title="Card title" description={<Link href="#">Card subtitle</Link>} />
ReactNode

The tools to render at the end of the header. Usually a menu, icon button, or badge. For buttons, use the "small" size variant.

Examples:
<CardHeader title="Card title" tools={<IconButton size="small" icon={<IconRatingStar />} aria-label="Favorite" />} />
string

The element's unique identifier. See MDN.

boolean

Use this attribute to "claim" the component tree for exclusive Cimpress UI usage.

string

Sets the CSS className for the element. Only use as a last resort. Use style props instead.

See styling guide.

CSSProperties

Sets the CSS style for the element. Only use as a last resort. Use style props instead.

See styling guide.

Renders a single block of content within Card.

CardContentProps
ReactNode

The content of this block.

boolean

Whether the block's content should stretch to the edges of the block.

Defaults to false .
string

The element's unique identifier. See MDN.

boolean

Use this attribute to "claim" the component tree for exclusive Cimpress UI usage.

string

Sets the CSS className for the element. Only use as a last resort. Use style props instead.

See styling guide.

CSSProperties

Sets the CSS style for the element. Only use as a last resort. Use style props instead.

See styling guide.

Renders a divider between adjacent content.

Ref<HTMLDivElement>

The ref type for this component.

DividerProps
'vertical' | 'horizontal'

The orientation of the divider (horizontal or vertical).

Defaults to 'horizontal' .
string

The element's unique identifier. See MDN.

boolean

Use this attribute to "claim" the component tree for exclusive Cimpress UI usage.

string

Sets the CSS className for the element. Only use as a last resort. Use style props instead.

See styling guide.

CSSProperties

Sets the CSS style for the element. Only use as a last resort. Use style props instead.

See styling guide.

StyleProps
Responsive<Spacing | "auto">

The amount of margin applied to all edges of this component.

Responsive<Spacing | "auto">

The amount of margin applied to the left and right edges of this component. Takes priority over margin.

Responsive<Spacing | "auto">

The amount of margin applied to the top and bottom edges of this component. Takes priority over margin.

Responsive<Spacing | "auto">

The amount of margin applied to the top edge of this component. Takes priority over marginY and margin.

Responsive<Spacing | "auto">

The amount of margin applied to the right edge of this component. Takes priority over marginX and margin.

Responsive<Spacing | "auto">

The amount of margin applied to the bottom edge of this component. Takes priority over marginY and margin.

Responsive<Spacing | "auto">

The amount of margin applied to the left edge of this component. Takes priority over marginX and margin.