Card grid
A responsive grid of cards: as many columns as the width allows (one on a phone), the cells of a row at one height, a staggered reveal; each card keeps its own quiet hover.
- Domaine
- Blocs de page et gabarits
- Niveau de support
- Taille
- 1.1 kB gzip, budget 0.8 kB
- Qui l'utilise
- 11 fichiers des produits et sites en production l'importent (Sovkora : 1, krizaka.com : 2) Compté dans l'inventaire daté du 2026-11-23.
import { CardGrid } from "@krizaka/ui/card-grid";Web uniquement — React, depuis @krizaka/ui/card-grid. Bêta : son API peut encore changer à une version mineure.
- Mobile · n/a. A block of a public site's page; an app screen on a phone is built from Screen, Header and Card. → Card
- Bureau · n/a. A public site's page, not a window of the Mac app.
Pourquoi il est là. Used by Verikora, Folioviv, krizaka.com.
Quand l’utiliser
- Entry points of a hub (
LinkCard), the reasons of a product page (ArgumentCard), plans, products. - Any set of peer cards that should read as one group with one rhythm.
Quand ne pas l’utiliser
- For a sequence the reader follows in order.À la place : Stepper
- For rows of data to compare or sort.À la place : Data table
Installation
Installer
npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcssStyles
@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";Importer
import { CardGrid } from "@krizaka/ui/card-grid";Exemples
Two halves
fit="fit": two cards share the whole width.
An aligned row
Cards with sentences of different lengths: one height, and the facts and the way in of every card on the same line.
A foundation
foundation: one wide card the others stand on, a hairline to a frame around them.
A list of sections
as="ul", six links that rise staggered by column on a real page.
The hover
The grid adds no hover: each card's surface and hairline go one step up, a ring on focus.
Props
A responsive grid of cards: equal rows, a staggered reveal.
| Prop | Type | Défaut | Description |
|---|---|---|---|
childrenrequis | ReactNode | — | The cards: one cell each. |
align | "start" | "stretch" | stretch | stretch gives the cells of a row one height; start lets each card keep its own (cards that open a panel). |
as | "div" | "ol" | "ul" | div | ul when the cards are a list (each cell an li). |
columns | number | 3 | The columns the stagger counts (the delay restarts on every row). |
fit | "fill" | "fit" | fill | fill keeps empty tracks (a lone card keeps its width); fit stretches the cards of a short row across the width. |
foundation | ReactNode | — | A foundation: one wide card that the cards of the grid stand on (an engine, a platform, a shared service). It spans
the full width beside the grid, and a hairline joins it to a frame around the cards — "everything inside runs on it".
The frame takes the hue of className (a data-hue or a brand class on the grid sets it for the whole block). |
foundationLabel | ReactNode | — | A short mono label on the frame's edge, naming the relation (Powered by Sovkora). Only with foundation. |
foundationPosition | "start" | "end" | start | Where the foundation sits: above the cards, or under them. |
hover | CardHover | — | @deprecated Since 3.31 (krizaka-ui#393): does nothing — every card has the one quiet hover. Removed in 4.0. |
light | boolean | — | @deprecated Since 3.31 (krizaka-ui#393): does nothing — no light follows the pointer. Removed in 4.0. |
min | number | 300 | The narrowest a column may be, in pixels: the grid fits as many columns as the width allows. |
reveal | boolean | true | The cards rise once into place ([data-reveal], MotionObserver), staggered by column. false on the first screen. |
Accessibilité
- The grid adds no role;
as="ul"makes it a list (each cell anli). - Nothing follows the pointer:
lightandhoverare deprecated since 3.31 (krizaka-ui#393) and do nothing. - Revealed cells are only hidden visually until they enter the viewport; under reduced motion they never move.
Bonnes pratiques
- Set
minto the narrowest a card still reads well; the grid does the rest at every width. fit="fit"for two or three cards that should share the whole width;fillkeeps a lone card at its size.- Keep
revealon below the first screen, off on it;columnsmakes the stagger restart on each row. - The default
align="stretch"gives a row one height; the cards pin their foot to the bottom (LinkCardfacts + way in,ArgumentCardactions) so the footers line up.align="start"for cards that unfold. as="ul"when the cards are a list of links.foundationwhen one thing (an engine, a platform) carries all the others: it takes its own card, wide, above (foundationPosition="end"for under), and the cards sit in a hairline frame joined to it. Say the relation withfoundationLabel; set the hue onclassName.
Composants liés
Générée depuis le code de @krizaka/ui 5.3.4 : son meta.ts, ses exemples et ses types.Modifier cette documentation sur GitHub