Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/aurelienbobenrieth/gadget/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The Card component provides a flexible container with multiple sub-components for building structured content layouts. Includes CardHeader, CardTitle, CardDescription, CardContent, and CardFooter.

Import

import {
  Card,
  CardHeader,
  CardTitle,
  CardDescription,
  CardContent,
  CardFooter
} from "@aurelienbbn/gadget-ui/components";

Basic Usage

<Card>
  <CardHeader>
    <CardTitle>Card Title</CardTitle>
    <CardDescription>A brief description of the card content.</CardDescription>
  </CardHeader>
  <CardContent>
    <p>Your main content goes here.</p>
  </CardContent>
</Card>

Sub-Components

Card

The root container component.
<Card>
  {/* Card content */}
</Card>
Styling: Rounded corners, surface background, border, and subtle shadow.

CardHeader

Container for the card’s header section.
<CardHeader>
  <CardTitle>Title</CardTitle>
  <CardDescription>Description</CardDescription>
</CardHeader>
Styling: Flex column layout with 4px gap and 16px padding on all sides.

CardTitle

Heading for the card (renders as <h3>).
<CardTitle>Your Title</CardTitle>
Styling: 14px (sm) font, semibold weight, foreground color, tight leading.

CardDescription

Subheading or description text (renders as <p>).
<CardDescription>Additional context or description</CardDescription>
Styling: 12px (xs) font, muted foreground color.

CardContent

Main content area of the card.
<CardContent>
  {/* Your content */}
</CardContent>
Styling: Horizontal padding of 16px (4), bottom padding of 16px (4).

CardFooter

Footer section for actions or additional information.
<CardFooter>
  <Button>Action</Button>
</CardFooter>
Styling: Flex row layout, items centered, 16px horizontal padding, 16px bottom padding, no top padding.

Props

All Card sub-components extend their respective HTML element attributes:
Card.className
string
Additional CSS classes for the Card container.
CardHeader.className
string
Additional CSS classes for CardHeader.
CardTitle.className
string
Additional CSS classes for CardTitle.
CardDescription.className
string
Additional CSS classes for CardDescription.
CardContent.className
string
Additional CSS classes for CardContent.
Additional CSS classes for CardFooter.

Examples

Complete Card

<Card>
  <CardHeader>
    <CardTitle>Feature Name</CardTitle>
    <CardDescription>
      This feature helps you accomplish important tasks.
    </CardDescription>
  </CardHeader>
  <CardContent>
    <p>Detailed information about the feature.</p>
  </CardContent>
  <CardFooter>
    <Button variant="primary">Learn More</Button>
    <Button variant="ghost">Dismiss</Button>
  </CardFooter>
</Card>

Simple Card

<Card>
  <CardContent>
    <p>Just some content without header or footer.</p>
  </CardContent>
</Card>

Custom Styling

<Card className="max-w-md">
  <CardHeader className="bg-accent-muted/10">
    <CardTitle className="text-accent">Highlighted</CardTitle>
  </CardHeader>
  <CardContent>
    <p>Content with custom header styling.</p>
  </CardContent>
</Card>

Component Definition

Location: packages/gadget-ui/src/components/card.tsx All Card sub-components use forwardRef to support ref forwarding to their underlying HTML elements.

Build docs developers (and LLMs) love