Shortcuts
Next region
F9
Previous region
⇧F9

Card

core package4.0.1

Note: All components shown on this site are supported by the Constellation design system. To learn how to configure Theme Cosmos, visit Pega Community.

Cards represent a complete collection of information about an entity or region. They are used to visually group blocks of content or interactions together.

Usage

The Card component is an <article/> that is designed to elevate content against a non-primary color background. It will render any children passed to it and will grow or shrink in size accordingly.

Examples

Simple Card

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Anatomy

Media

The CardMedia component is intended to wrap Images, videos, or audio content. It will stretch the content to the full width of the Card. While it can be used anywhere within a Card, it is best utilized at the top, above any header.

Header

The CardHeader component will render its content, typically Text, at the top of a Card. If actions are provided, they will render inline with the other header content.

Content

The CardContent component is a Flex container capable of accepting any Flex container props. It is reccommended to use the CardContent component to wrap any content in order to apply proper padding throughout the Card.

Footer

The CardFooter component will render its children at the bottom of a Card. This content can be aligned using the justify prop.

Full demo

Examples

Media

Full Card

Card actions
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Related components

Properties

NameDescriptionDefaultType
asHTML tag or React Component to render the component as.ElementType
childrenComponents and content for the Card.ReactNode
classNameAdditional CSS classes.string
forwardedAsHTML tag or React Component to finally render the component as.ElementType
interactiveEnables the focus, hover, and active styles.falseboolean
onClickCallback for onClick event.MouseEventHandler<HTMLElement>
refRef forwarded to the wrapping element.Ref<HTMLElement>