Card

A container that groups related content and actions.

Import

import { Card } from '@matix/components/card';

Usage

Project Alpha

A brief summary of the project.

Card body content goes here.

Variants

Default

Bordered card

Elevated

Shadow card

Ghost

No border

Structured Card

Use all sub-components together for a complete card layout.

Team Settings

Manage your team members and permissions.

You have 12 active members across 3 roles.

Header Action

Put a button or menu in Card.Action. It sits at the top right of the header, next to the title and the description.

Billing

Your plan renews on 1 December.

Pro plan, 5 seats.

Without Dividers

Card.Header and Card.Footer draw a divider by default. Set divider={false} to remove it.

Invite a teammate

They get access to every project.

Send the invite to a work address.

Custom Styles

import * as stylex from '@stylexjs/stylex';
import { colors } from '@matix/tokens';

const custom = stylex.create({
  primary: { borderColor: colors.primary, borderWidth: '2px' },
});

<Card sx={custom.primary}>
  <Card.Header>
    <Card.Title>Highlighted</Card.Title>
  </Card.Header>
  <Card.Body>A card with a custom primary border.</Card.Body>
</Card>;

API Reference

Card

PropTypeDefaultDescription
variant'default' | 'elevated' | 'ghost''default'Visual style
sxStyleXStyles—StyleX style override
childrenReactNode—Card content

Card.Header

A grid. Card.Action takes a second column at the top right.

PropTypeDefaultDescription
dividerbooleantrueDraws a divider between header and body
childrenReactNode—Header content
sxStyleXStyles—StyleX style override

Card.Title

Renders an <h3> element by default.

PropTypeDefaultDescription
as'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'div''h3'The element to render
childrenReactNode—Title text
sxStyleXStyles—StyleX style override

Card.Description

Renders a <p> element with muted styling.

PropTypeDefaultDescription
childrenReactNode—Description text
sxStyleXStyles—StyleX style override

Card.Action

Place it inside Card.Header. It aligns to the top right and spans the title and description rows.

PropTypeDefaultDescription
childrenReactNode—Buttons or a menu
sxStyleXStyles—StyleX style override

Card.Body

PropTypeDefaultDescription
childrenReactNode—Body content
sxStyleXStyles—StyleX style override
PropTypeDefaultDescription
dividerbooleantrueDraws a divider between body and footer
childrenReactNode—Footer content
sxStyleXStyles—StyleX style override

Accessibility

  • Card renders a plain <div> with no implicit ARIA role. If the card represents a distinct landmark, add role="region" and aria-label manually.
  • Card.Title renders an <h3> by default. Set as to the level that fits your page outline, for example as="h2" directly under the page <h1>.
  • Interactive elements inside Card (buttons, links) are reachable via normal tab order.

This is an RSC-safe component — it ships no JavaScript to the browser.