Card is a component for grouping similar content in a container.

Importing

The component can be imported via:

import { 
	Card, 
	CardHeader, 
	CardTitle,
	CardActions, 
	CardSection, 
} from '@customerio/pluma-components/react';

A Card component can be composed with the following child components:

  • CardHeader
    • a container component for the Card's header section
  • CardTitle
    • the Card's title, must be nested within a CardHeader
  • CardActions
    • a container for actions, such as links or buttons. Must be nested within a CardHeader. By default, buttons inside this section render as sm subtle buttons
  • CardSection
    • a container component for content in the Card. CardHeader is a CardSection internally
    • CardSection components are separated by a small gap

Usage

A complete example, using all the available child components, looks like:

Loading editor

Section Padding

By default, a CardSection will render with:

  • a top padding, if it's the first child of the Card
  • a bottom padding, if it's the last child of the Card
  • left and right paddings

By setting withPadding={false}, the CardSection component will stretch to the edges of the Card instead, which is useful for adding full-width content, like dividers or images.

Loading editor
Loading editor

API

PlumaCard extends Box

Default:'div'

What element or component should be rendered.

Default:'div'

What element or component should be rendered.

Default:'div'

What element or component should be rendered.

Default:'div'

What element or component should be rendered.

Default:true

Whether the section should render with padding. If false, the section will stretch like a CardInset, but with a gap between other sections. When true (default), the section includes standard Card padding.

Default:'span'

What element or component should be rendered.

On this page