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.
  • UNSTABLE_ActionCard: a card that performs an action or navigates when pressed. Accepts the same content as Card.
import { Card, CardContent, CardHeader, Divider, UNSTABLE_ActionCard } from '@cimpress-ui/react';

UNSTABLE_ActionCard renders a link when you pass an href, and a button otherwise.

Interactive elements are positioned above the action, so they stay usable. If you render a custom interactive element that doesn’t match these, set position: relative on it.

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.

Action cards use the title of their CardHeader as their accessible name, and the header description as their accessible description. If the card has no header, provide an aria-label or aria-labelledby.

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.

A card that performs an action or navigates when pressed. Accepts the same content as Card, and can contain other interactive elements such as buttons and links.

See card usage guidelines.

Ref<HTMLDivElement>

The ref type for this component.

UNSTABLE_ActionCardProps
ReactNode

The contents of the card.

(props: (DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>) | (DetailedHTMLProps<LinkWithRequiredHref, HTMLAnchorElement>), renderProps: LinkRenderProps) => ReactElement

Renders a custom element, e.g. your router's link component. Render an <a> if 'href' in props, otherwise a <span>. Only used when href is provided.

See client-side routing guide.

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.

string

Defines a string value that labels the current element.

string

Identifies the element (or elements) that labels the current element.

string

Identifies the element (or elements) that describes the object.

string

Identifies the element (or elements) that provide a detailed, extended description for the object.

string

A URL to link to.

undefined

Options for the configured client side router.

string

Hints at the human language of the linked URL. SeeMDN.

HTMLAttributeAnchorTarget

The target window for the link. See MDN.

string

The relationship between the linked resource and the current page. See MDN.

string | boolean

Causes the browser to download the linked URL. A string may be provided to suggest a file name. See MDN.

string

A space-separated list of URLs to ping when the link is followed. See MDN.

HTMLAttributeReferrerPolicy

How much of the referrer to send when following the link. See MDN.

(e: HoverEvent) => void

Handler that is called when a hover interaction starts.

(e: HoverEvent) => void

Handler that is called when a hover interaction ends.

(e: PressEvent) => void

Handler that is called when the press is released over the target.

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.