- Docs
- Components
- 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
// 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.
| Prop | Type | Default | What it does |
|---|---|---|---|
title · level | ReactNode · 1 – 6 | — | The title in the ruled header, a heading at level: the card becomes a section named by it. |
description | ReactNode | — | A line under the title. |
actions | ReactNode | — | At the header's end: a ghost View all. |
footer | ReactNode | — | 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. |
render | ReactElement | a <section> or <div> | Another element: <article />. |
03
Parts
Each part carries a data-slot, for tests and placement.
| data-slot | Element | What 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.
<Card footer={<Pagination offset={offset} pageSize={25} total={1284} onOffsetChange={setOffset} />}>
<Table label="Users" … />
</Card>