Skip to main content
  1. Docs
  2. Components
  3. Layout

Card

Related content on a page: a raised, ruled surface with no shadow. A titled card is a section named by its title.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<section>Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

Import

card.tsx
// From the package: a build keeps only what it uses.
import { Card } from "@qeetrix/react";

// Or from its own path.
import { Card } from "@qeetrix/react/card";

02

Props

And every native attribute of the element it renders.

PropTypeDefaultWhat it does
title · levelReactNode · 1 – 6—The title in the ruled header, a heading at level: the card becomes a section named by it.
descriptionReactNode—A line under the title.
actionsReactNode—At the header's end: a ghost View all.
footerReactNode—A ruled footer: the card's actions.
variant"default" | "subdued""default"subdued: the sunken surface, for a secondary panel.
tone"neutral" | "danger""neutral"danger: the border and title, for a danger zone.
renderReactElementa <section> or <div>Another element: <article />.

03

Parts

Each part carries a data-slot, for tests and placement.

data-slotElementWhat it is
card<section>Titled: aria-labelledby its title. Untitled: a <div>.
card-header<div>The heading and the actions.
card-description<p>The line under the title.
card-body<div>The content.
card-footer<div>The footer.

04

A table and its pages

The Table edge to edge in the body, Pagination in the footer.

users-card.tsx
<Card footer={<Pagination offset={offset} pageSize={25} total={1284} onOffsetChange={setOffset} />}>
  <Table label="Users" … />
</Card>
Next — CardAccessibility