Cards
Arrange content in a responsive grid of cards with icons and titles.
Beta
- Introduced
- v0.3.4
- Supported through
- Latest
Usage
Use Cards to arrange Card components in a grid. Each card accepts a title, an optional icon, and Markdown or JSX content.
Hello, World!
你好世界
Hello, CodeAltas!
你好世界
Write with MDX
Mix Markdown and components in your documentation.
Built with TypeScript
Use typed components in your Next.js project.
Usage
<Cards cols="2">
<Card icon="lucide:book" title="Hello, World!">
你好世界
</Card>
<Card icon="lucide:book" title="Hello, CodeAltas!">
你好世界
</Card>
</Cards>Columns
Set cols to a number or string from 1 to 4. The default is 2.
Cards stack in a single column on small screens. Three- and four-column grids use two columns on medium screens.
Hello, World!
你好世界
Hello, CodeAltas!
你好世界
Single Column
<Cards cols="1">
<Card icon="lucide:book" title="Hello, World!">
你好世界
</Card>
<Card icon="lucide:book" title="Hello, CodeAltas!">
你好世界
</Card>
</Cards>Standalone Card
Card can also be used without Cards. Icons use the same names as Hint and Step.
Keep it simple
Cards support Markdown, links, and custom components.
Props
Cards Props3 properties
| Property | Type | Default | Description |
|---|---|---|---|
cols | 1 | 2 | 3 | 4 | '1' | '2' | '3' | '4' | 2 | Number of columns on large screens. Cards stack on small screens. |
children | React.ReactNode | - | Card components to display in the grid. |
className | string | - | Additional classes for the grid. |
Card Props4 properties
| Property | Type | Default | Description |
|---|---|---|---|
title | React.ReactNode | - | Required card title. |
icon | string | - | A Lucide or Simple Icons name, such as lucide:book or simple:typescript. |
children | React.ReactNode | - | Card content, including Markdown and custom components. |
className | string | - | Additional classes for the card. |
Both components accept className and standard <div> attributes.

