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.
Variants
Default
Elevated
Ghost
Structured Card
Use all sub-components together for a complete card layout.
Team Settings
Manage your team members and permissions.
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.
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.
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
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'default' | 'elevated' | 'ghost' | 'default' | Visual style |
sx | StyleXStyles | — | StyleX style override |
children | ReactNode | — | Card content |
Card.Header
A grid. Card.Action takes a second column at the top right.
| Prop | Type | Default | Description |
|---|---|---|---|
divider | boolean | true | Draws a divider between header and body |
children | ReactNode | — | Header content |
sx | StyleXStyles | — | StyleX style override |
Card.Title
Renders an <h3> element by default.
| Prop | Type | Default | Description |
|---|---|---|---|
as | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'div' | 'h3' | The element to render |
children | ReactNode | — | Title text |
sx | StyleXStyles | — | StyleX style override |
Card.Description
Renders a <p> element with muted styling.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Description text |
sx | StyleXStyles | — | StyleX style override |
Card.Action
Place it inside Card.Header. It aligns to the top right and spans the title and description rows.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Buttons or a menu |
sx | StyleXStyles | — | StyleX style override |
Card.Body
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Body content |
sx | StyleXStyles | — | StyleX style override |
Card.Footer
| Prop | Type | Default | Description |
|---|---|---|---|
divider | boolean | true | Draws a divider between body and footer |
children | ReactNode | — | Footer content |
sx | StyleXStyles | — | StyleX style override |
Accessibility
- Card renders a plain
<div>with no implicit ARIA role. If the card represents a distinct landmark, addrole="region"andaria-labelmanually. Card.Titlerenders an<h3>by default. Setasto the level that fits your page outline, for exampleas="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.