Skip to main content

Card

The Card component provides a flexible container for displaying related content, media, links, and actions.

Cards are built from several composable subcomponents that can be combined to create simple or highly customized layouts.

Import​

import { Card } from "@promethey/bsui";

Note

Badge inherits all utility props supported by the Prime component, including layout, spacing, typography, colors, borders, sizing, positioning, and other Bootstrap utility APIs.

Basic usage​

Images​

Display an image above or below the card body.

Bottom image​

Use the placement prop to move the image below the content.

Semantic headers​

The as prop allows semantic heading elements.

Images​

Use Card.Image to display an image at the top or bottom of the card.

Image placement can be changed using the placement prop.

Cards support optional header and footer sections.

Titles and Subtitle​

Use Card.Title and Card.Subtitle to organize textual content.

Use Card.Link to create Bootstrap-styled links inside card content.

Utility props​

All utility props provided by Prime are supported.

API​

Card​

PropTypeDefaultDescription
childrenReactNode—Card content.
classNamestring—Additional CSS classes.
styleobject—Inline styles.
aselementType"div"HTML element used for rendering.

Card.Body​

PropTypeDefaultDescription
childrenReactNode—Body content.
classNamestring—Additional CSS classes.
styleobject—Inline styles.
aselementType"div"HTML element used for rendering.

Card.Header​

PropTypeDefaultDescription
childrenReactNode—Header content.
classNamestring—Additional CSS classes.
styleobject—Inline styles.
as"div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6""div"HTML element used for rendering.

Card.Footer​

PropTypeDefaultDescription
childrenReactNode—Footer content.
classNamestring—Additional CSS classes.
styleobject—Inline styles.
as"div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6""div"HTML element used for rendering.

Card.Image​

PropTypeDefaultDescription
srcstring—Image source.
altstring—Alternative text.
placement"top" | "bottom""top"Image placement inside the card.
classNamestring—Additional CSS classes.
styleobject—Inline styles.

Card.Title​

PropTypeDefaultDescription
childrenReactNode—Title content.
classNamestring—Additional CSS classes.
styleobject—Inline styles.
as"h1" | "h2" | "h3" | "h4" | "h5" | "h6""h5"HTML element used for rendering.

Card.Subtitle​

PropTypeDefaultDescription
childrenReactNode—Subtitle content.
classNamestring—Additional CSS classes.
styleobject—Inline styles.
as"h1" | "h2" | "h3" | "h4" | "h5" | "h6""h6"HTML element used for rendering.

Card.Text​

PropTypeDefaultDescription
childrenReactNode—Text content.
classNamestring—Additional CSS classes.
styleobject—Inline styles.
PropTypeDefaultDescription
childrenReactNode—Link content.
tostring"#"Navigation target.
classNamestring—Additional CSS classes.
styleobject—Inline styles.

Card.Group​

PropTypeDefaultDescription
childrenReactNode—Card collection.
classNamestring—Additional CSS classes.
styleobject—Inline styles.
aselementType"div"HTML element used for rendering.