adn-ui
Components

Card

A versatile card component for grouping related information, actions, and media.

The Card component organizes related content, actions, and media into a clean, elevated container.

Usage

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

export function ExampleCard() {
  return (
    <Card.Root>
      <Card.Header>
        <Card.Title>Notifications</Card.Title>
        <Card.Description>You have 3 unread messages.</Card.Description>
      </Card.Header>
      <Card.Content>
        <p className="text-sm">Message list goes here...</p>
      </Card.Content>
      <Card.Footer>
        <button>Mark all as read</button>
      </Card.Footer>
    </Card.Root>
  );
}

Preview

Notifications

You have 3 unread messages.

Your team subscription has been renewed successfully for another month.

Custom Styling

Apply custom gradient borders, glassmorphism, or hover shadows via inline className:

<Card.Root className="max-w-sm border-0 bg-gradient-to-br from-indigo-500/10 via-purple-500/5 to-background p-1 ring-1 ring-indigo-500/20 shadow-xl">
  <Card.Header>
    <Card.Title className="text-indigo-600 dark:text-indigo-400">Pro Feature</Card.Title>
    <Card.Description>Unlock advanced analytics and team controls.</Card.Description>
  </Card.Header>
  <Card.Content>
    <p className="text-sm font-semibold">$29 / month per seat</p>
  </Card.Content>
</Card.Root>

Pro Feature

Unlock advanced analytics and team controls.

Gain full access to data export and team permissions.

Styling & Class Names

Target internal card CSS slots for custom overrides:

Class NameElement / SlotDescription
.cardRoot card containerElevated border, background, and rounded container.
.card__headerCard headerHeader section with padding and flex column gap.
.card__titleTitle textBold heading title styles.
.card__descriptionDescription textMuted description subtitle styles.
.card__contentContent sectionMain card body content area.
.card__footerFooter sectionBottom action bar with flex alignment.

API Reference

Card.Root Props

PropTypeDefaultDescription
classNamestringundefinedAdditional inline CSS utility classes.

On this page