Card

Displays content inside a styled container.

Examples

Default

Account Summary Overview of your account activity.
Monthly Spend $1,240.00
Open Invoices 3
View Details
<c-card>
  <c-card-header>
    <c-card-title>Account Summary</c-card-title>
    <c-card-description>Overview of your account activity.</c-card-description>
  </c-card-header>
  <c-card-content>
    <div class="grid gap-2">
      <div class="flex items-center justify-between text-sm">
        <span class="text-muted-foreground">Monthly Spend</span>
        <span class="font-medium">$1,240.00</span>
      </div>
      <div class="flex items-center justify-between text-sm">
        <span class="text-muted-foreground">Open Invoices</span>
        <span class="font-medium">3</span>
      </div>
    </div>
  </c-card-content>
  <c-card-footer>
    <c-button size="sm">View Details</c-button>
  </c-card-footer>
</c-card>

With Form

Create project Deploy your new project in one-click.
Name
Repository
Cancel Deploy
<c-card card-classes="w-full max-w-md">
  <c-card-header>
    <c-card-title>Create project</c-card-title>
    <c-card-description
      >Deploy your new project in one-click.</c-card-description
    >
  </c-card-header>
  <c-card-content>
    <div class="grid gap-4">
      <div class="grid gap-2">
        <c-label label-for="project-name">Name</c-label>
        <c-input id="project-name" placeholder="New app"></c-input>
      </div>
      <div class="grid gap-2">
        <c-label label-for="project-repo">Repository</c-label>
        <c-input
          id="project-repo"
          placeholder="https://github.com/acme/app"
        ></c-input>
      </div>
    </div>
  </c-card-content>
  <c-card-footer card-footer-classes="justify-between">
    <c-button variant="outline">Cancel</c-button>
    <c-button>Deploy</c-button>
  </c-card-footer>
</c-card>

Notifications

Notifications You have 3 unread messages.

New order received

2 minutes ago

Payment processed

1 hour ago

New comment on ticket

Yesterday

Mark all as read
<c-card card-classes="w-full max-w-sm">
  <c-card-header>
    <c-card-title>Notifications</c-card-title>
    <c-card-description>You have 3 unread messages.</c-card-description>
  </c-card-header>
  <c-card-content>
    <div class="grid gap-4">
      <div class="flex items-start gap-4">
        <span class="mt-2 inline-flex size-2 rounded-full bg-primary"></span>
        <div class="space-y-1">
          <p class="text-sm font-medium">New order received</p>
          <p class="text-sm text-muted-foreground">2 minutes ago</p>
        </div>
      </div>
      <div class="flex items-start gap-4">
        <span class="mt-2 inline-flex size-2 rounded-full bg-primary"></span>
        <div class="space-y-1">
          <p class="text-sm font-medium">Payment processed</p>
          <p class="text-sm text-muted-foreground">1 hour ago</p>
        </div>
      </div>
      <div class="flex items-start gap-4">
        <span class="mt-2 inline-flex size-2 rounded-full bg-primary"></span>
        <div class="space-y-1">
          <p class="text-sm font-medium">New comment on ticket</p>
          <p class="text-sm text-muted-foreground">Yesterday</p>
        </div>
      </div>
    </div>
  </c-card-content>
  <c-card-footer card-footer-classes="justify-end">
    <c-button size="sm">Mark all as read</c-button>
  </c-card-footer>
</c-card>

Login Card

Login to your account Enter your email below to login to your account
Sign Up
Login Login with Google
<c-card card-classes="w-full max-w-sm">
  <c-card-header>
    <div class="flex items-start justify-between">
      <div class="space-y-1.5">
        <c-card-title>Login to your account</c-card-title>
        <c-card-description
          >Enter your email below to login to your account</c-card-description
        >
      </div>
      <c-button variant="link" size="sm">Sign Up</c-button>
    </div>
  </c-card-header>
  <c-card-content>
    <form>
      <div class="flex flex-col gap-6">
        <div class="grid gap-2">
          <c-label label-for="login-email">Email</c-label>
          <c-input
            id="login-email"
            type="email"
            placeholder="m@example.com"
            required
          ></c-input>
        </div>
        <div class="grid gap-2">
          <div class="flex items-center">
            <c-label label-for="login-password">Password</c-label>
            <a
              href="#"
              class="ms-auto inline-block text-sm underline-offset-4 hover:underline"
            >
              Forgot your password?
            </a>
          </div>
          <c-input id="login-password" type="password" required></c-input>
        </div>
      </div>
    </form>
  </c-card-content>
  <c-card-footer card-footer-classes="flex-col gap-2">
    <c-button type="submit" class="w-full" button-classes="w-full"
      >Login</c-button
    >
    <c-button variant="outline" class="w-full" button-classes="w-full"
      >Login with Google</c-button
    >
  </c-card-footer>
</c-card>

API Reference

Card

The root container for the card component family.

Prop Type Default Description
card-classes string - Additional CSS classes for the card container

CardHeader

Container for the title and description.

Prop Type Default Description
card-header-classes string - Additional CSS classes for the header container

CardTitle

Heading element for the card title.

Prop Type Default Description
card-title-classes string - Additional CSS classes for the title element

CardDescription

Muted text description for the card.

Prop Type Default Description
card-description-classes string - Additional CSS classes for the description text

CardContent

Main content area of the card.

Prop Type Default Description
card-content-classes string - Additional CSS classes for the content container

CardFooter

Footer area for actions.

Prop Type Default Description
card-footer-classes string - Additional CSS classes for the footer container