Skip to content

Components · Data display

Card

Grouped content surface.

@rookcom/monarch-reactComponent

Variants

Open tickets

outline card

128

Open tickets

raised card

128

Open tickets

subtle card

128

Usage examples

The example at the top of the page is the only one for this component.

Purpose

A bordered surface that groups related content, with optional header, content and footer parts.

Use when

  • Grouping one topic on a page, such as a summary or a form section.
  • Wrapping a table (flush).

Avoid when

  • Showing a single KPI: use StatCard.
  • A page-level settings group: use SettingsSection.

Design principles

  • outline (default) for most content, raised for floating panels, subtle inside other cards.
  • CardTitle defaults to h3 and takes as so it fits the page outline.

API reference

import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@rookcom/monarch-react';
ExportKindRenderingRoot class
Cardcomponentserver-safe.mn-card
CardContentcomponentserver-safe.mn-card
CardDescriptioncomponentserver-safe.mn-card
CardFootercomponentserver-safe.mn-card
CardHeadercomponentserver-safe.mn-card
CardTitlecomponentserver-safe.mn-card

Every part is a plain element (div, heading, p) and passes native attributes through.

Generated from the TypeScript declarations of packages/react/src/components/data-display/card.

Properties

Card

PropTypeDescription
childrenReactNode
classNamestring
flushbooleanRemove inner padding, e.g. for a card wrapping a table.
idstring
variant"subtle" | "outline" | "raised"`outline` (default) for most content, `raised` for floating panels, `subtle` inside other cards.

CardContent

PropTypeDescription
childrenReactNode
classNamestring
idstring

CardDescription

PropTypeDescription
childrenReactNode
classNamestring
idstring

CardFooter

PropTypeDescription
childrenReactNode
classNamestring
idstring

CardHeader

PropTypeDescription
childrenReactNode
classNamestring
idstring

CardTitle

PropTypeDescription
as"h2" | "h3" | "h4"Heading level that fits the page outline. Default h3.
childrenReactNode
classNamestring
idstring

Variants

PropValuesDescription
variant'outline''raised''subtle'Surface treatment. Default outline. Exposed as data-variant.
flush'true''false'Removes the content padding, e.g. for a card wrapping a table (data-flush).
CardTitle as'h2''h3''h4'Heading level. Default h3.

States

StateExposed asBehaviour
Static–Card has no interactive states of its own.

Interaction behaviour

  • None. Interactive content inside the card keeps its own behaviour.

Keyboard support

Not interactive, so there is no keyboard behaviour.

Accessibility

Role
none (div); CardTitle is a heading
Accessible name
–
  • CardTitle renders a real heading (h3 by default); choose as so heading levels do not skip.
  • The card adds no landmark or role; add aria-labelledby with a region role yourself if it needs one.

Responsive behaviour

  • No breakpoints: the card fills the width its container gives it.

Theme support

  • Borders and surfaces use Monarch semantic tokens, so every theme applies automatically.

Do and don't

Do

  • Set CardTitle as to match the page outline.
  • Use flush when a table fills the card.

Don't

  • Do not nest outline cards; use subtle for an inner card.
  • Do not make the whole card a click target without a real link or button inside.

Dependencies

KindDepends on
npm packagesNone
Monarch componentsNone

Testing coverage

  • Renders CardTitle as an h3 by default.
CheckCovered
Axe in jsdomYes
Server renderingYes
Browser suitesVisual baselines: /__gallery

Tests: packages/react/src/components/data-display/card