Skip to content
SENVENLI UI

Card

A surface that groups related content about one object, optionally a link or a button as a whole.
Header, body and footer
import {
  Card,
  CardHeader,
  CardBody,
  CardFooter,
  CardMedia,
} from "@senvenli/react/display";

Examples

With a photo

CardMedia sits flush to the edges at 16:9; without a `src` it shows an icon.

A card that is a link

The whole tile is one link named by its title, so it holds no other controls.

Variants

Raised on the page, outline inside another surface, sunken for summaries.

Guidelines

When to use it

  • Grouping content about one object on a page.
  • A whole tile that opens a page (href) or a panel (onPress).

Use something else when

  • Only a boundary between groups is needed. Separator

Do and avoid

  • An interactive card holds no controls except the header menu.

Accessibility

Built in

  • An interactive card is one focusable element named by its header title.

You provide

  • A CardHeader title, or aria-label on an interactive card without one.

API reference

Card

variant
CardVariant

raised on the page · outline inside cards and settings groups · sunken for summaries and code.

density
Density

compact: 16px padding instead of 24px.

radius
ComponentRadius

Corner radius: none to full; the design's large (or the provider's default) otherwise.

childrenRequired
React.ReactNode

Header, media, body and footer parts.

aria-label
string

The card's name when it is interactive and has no CardHeader title.

href
string

The whole card is a link (the interactive card): one focusable element named by its title.

onPress
() => void

The whole card is a button (opens a panel rather than a page).

CardHeader

titleRequired
React.ReactNode
subtitle
React.ReactNode
headingLevel
CardHeadingLevelDefault 3

Heading level of the title; default 3.

actions
React.ReactNode

At the header's end: a subtle menu button (Button variant="subtle" iconOnly); stays clickable above an interactive card.

CardBody

childrenRequired
React.ReactNode

CardFooter

childrenRequired
React.ReactNode

CardMedia

src
string

The photo, flush to the card edges at 16:9 and covering the frame.

alt
stringDefault ""

Describes the photo; "" when the title already says what it shows.

fallbackIcon
IconNameDefault "image"

Shown on ds-surface-sunken when there is no photo.