viabl
Theme
Components

Cards

Display content in a structured, clickable card layout using Card and CardGroup components.

Overview

The Card and CardGroup components provide a flexible way to present content in a clean, grid-based layout. They are ideal for navigation, feature highlights, and documentation entry points.

  • Card: A single content container with optional icon and link.
  • CardGroup: A responsive grid wrapper for organizing multiple cards.

Example


Card

A responsive grid layout for organizing multiple Card components.

mdx
<Card title="Getting Started">Get up and running quickly.</Card>

Icon Usage

Icons are resolved dynamically from lucide-react. If the icon name is not found, the value will be rendered as plain text or emoji:

mdx
<Card title="Analytics" icon="BarChart3">
  View insights and metrics.
</Card>

CardGroup

A responsive grid layout for organizing multiple Card components.

mdx
<CardGroup cols={2}>
  <Card title="Getting Started" icon="Rocket" href="/introduction">
    Get up and running quickly.
  </Card>
  <Card title="API Reference" icon="Code2" href="/api-reference/overview">
    Explore all available endpoints.
  </Card>
</CardGroup>

Props

Card component

PropTypeRequiredDescription
titlestringyesThe main heading displayed on the card.
iconstringNoName of a Lucide icon (e.g. "Rocket"). Falls back to text/emoji if not found.
hrefstringNoIf provided, the card becomes clickable and navigates to this route.
childrenReact.ReactNodeNoAdditional descriptive content displayed below the title.

CardGroup

PropTypeDefaultDescription
colsnumber2Number of columns in the grid (1–4 supported).
childrenReact.ReactNodeYesThe Card components to render inside the grid.

Accessibility Notes

  • Cards with href behave as links and are keyboard-accessible via Next.js Link.
  • Ensure title clearly describes the destination or purpose.
  • Avoid relying solely on color to convey meaning.
Was this page helpful?