Card API
Import
Section titled “Import”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 withinCard.Divider: renders a line between card sections to visually separate them.
import { Card, CardContent, CardHeader, Divider } from '@cimpress-ui/react';Accessibility notes
Section titled “Accessibility notes”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.
API reference
Section titled “API reference”Groups related blocks of content into a single unit.
- Ref<HTMLDivElement>
-
The
reftype for this component.
CardProps
- ReactNode
children *
Section titled “ children * ” -
The contents of the card.
- string
-
The element's unique identifier. See MDN.
- boolean
data-cim-style-root
Section titled “ data-cim-style-root ” -
Use this attribute to "claim" the component tree for exclusive Cimpress UI usage.
- string
UNSAFE_className
Section titled “ UNSAFE_className ” -
Sets the CSS className for the element. Only use as a last resort. Use style props instead.
See styling guide.
- CSSProperties
UNSAFE_style
Section titled “ UNSAFE_style ” -
Sets the CSS style for the element. Only use as a last resort. Use style props instead.
See styling guide.
StyleProps
- Responsive<Spacing | "auto">
margin
Section titled “ margin ” -
The amount of margin applied to all edges of this component.
- Responsive<Spacing | "auto">
marginX
Section titled “ marginX ” -
The amount of margin applied to the left and right edges of this component. Takes priority over
margin. - Responsive<Spacing | "auto">
marginY
Section titled “ marginY ” -
The amount of margin applied to the top and bottom edges of this component. Takes priority over
margin. - Responsive<Spacing | "auto">
marginTop
Section titled “ marginTop ” -
The amount of margin applied to the top edge of this component. Takes priority over
marginYandmargin. - Responsive<Spacing | "auto">
marginRight
Section titled “ marginRight ” -
The amount of margin applied to the right edge of this component. Takes priority over
marginXandmargin. - Responsive<Spacing | "auto">
marginBottom
Section titled “ marginBottom ” -
The amount of margin applied to the bottom edge of this component. Takes priority over
marginYandmargin. - Responsive<Spacing | "auto">
marginLeft
Section titled “ marginLeft ” -
The amount of margin applied to the left edge of this component. Takes priority over
marginXandmargin.
CardHeader
Section titled “CardHeader”Renders a header within a Card.
CardHeaderProps
- ReactNode
title *
Section titled “ title * ” -
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
iconStart
Section titled “ iconStart ” -
The icon to display at the start of the header.
- ReactNode
description
Section titled “ description ” -
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
tools
Section titled “ tools ” -
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
data-cim-style-root
Section titled “ data-cim-style-root ” -
Use this attribute to "claim" the component tree for exclusive Cimpress UI usage.
- string
UNSAFE_className
Section titled “ UNSAFE_className ” -
Sets the CSS className for the element. Only use as a last resort. Use style props instead.
See styling guide.
- CSSProperties
UNSAFE_style
Section titled “ UNSAFE_style ” -
Sets the CSS style for the element. Only use as a last resort. Use style props instead.
See styling guide.
CardContent
Section titled “CardContent”Renders a single block of content within Card.
CardContentProps
- ReactNode
children *
Section titled “ children * ” -
The content of this block.
- boolean
fullBleed
Section titled “ fullBleed ” - Defaults to false .
Whether the block's content should stretch to the edges of the block.
- string
-
The element's unique identifier. See MDN.
- boolean
data-cim-style-root
Section titled “ data-cim-style-root ” -
Use this attribute to "claim" the component tree for exclusive Cimpress UI usage.
- string
UNSAFE_className
Section titled “ UNSAFE_className ” -
Sets the CSS className for the element. Only use as a last resort. Use style props instead.
See styling guide.
- CSSProperties
UNSAFE_style
Section titled “ UNSAFE_style ” -
Sets the CSS style for the element. Only use as a last resort. Use style props instead.
See styling guide.
Divider
Section titled “Divider”Renders a divider between adjacent content.
- Ref<HTMLDivElement>
-
The
reftype for this component.
DividerProps
- 'vertical' | 'horizontal'
orientation
Section titled “ orientation ” - Defaults to 'horizontal' .
The orientation of the divider (horizontal or vertical).
- string
-
The element's unique identifier. See MDN.
- boolean
data-cim-style-root
Section titled “ data-cim-style-root ” -
Use this attribute to "claim" the component tree for exclusive Cimpress UI usage.
- string
UNSAFE_className
Section titled “ UNSAFE_className ” -
Sets the CSS className for the element. Only use as a last resort. Use style props instead.
See styling guide.
- CSSProperties
UNSAFE_style
Section titled “ UNSAFE_style ” -
Sets the CSS style for the element. Only use as a last resort. Use style props instead.
See styling guide.
StyleProps
- Responsive<Spacing | "auto">
margin
Section titled “ margin ” -
The amount of margin applied to all edges of this component.
- Responsive<Spacing | "auto">
marginX
Section titled “ marginX ” -
The amount of margin applied to the left and right edges of this component. Takes priority over
margin. - Responsive<Spacing | "auto">
marginY
Section titled “ marginY ” -
The amount of margin applied to the top and bottom edges of this component. Takes priority over
margin. - Responsive<Spacing | "auto">
marginTop
Section titled “ marginTop ” -
The amount of margin applied to the top edge of this component. Takes priority over
marginYandmargin. - Responsive<Spacing | "auto">
marginRight
Section titled “ marginRight ” -
The amount of margin applied to the right edge of this component. Takes priority over
marginXandmargin. - Responsive<Spacing | "auto">
marginBottom
Section titled “ marginBottom ” -
The amount of margin applied to the bottom edge of this component. Takes priority over
marginYandmargin. - Responsive<Spacing | "auto">
marginLeft
Section titled “ marginLeft ” -
The amount of margin applied to the left edge of this component. Takes priority over
marginXandmargin.