Skip to content
Logic2BUI

Search docs

Search components and documentation

New
Menu

Card

Displays a card with header, content, and footer.

Login to your account
Enter your email below to login.

Installation

npx logic2b@next add card

Usage

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

<Card>
  <CardHeader>
    <CardTitle>Title</CardTitle>
    <CardDescription>Description</CardDescription>
    <CardAction>{/* e.g. a button, top-right */}</CardAction>
  </CardHeader>
  <CardContent>Content</CardContent>
  <CardFooter>Footer</CardFooter>
</Card>

Usage notes

Card is composed of layout primitives — Card, CardHeader, CardTitle, CardDescription, CardAction, CardContent, and CardFooter. Each is a styled div that accepts className plus the standard div props; there are no variant props. CardAction is positioned in the top-right of the header, and CardHeader switches to a two-column grid when a CardAction is present.

Examples

With action

Place a control such as a badge or button in the header via CardAction.

Total revenue
$45,231.89
+12.5%

Trending up compared to last month.

Notification

Combine header, content, and footer for a self-contained panel.

Notifications
You have 3 unread messages.

Your build is ready

2 minutes ago

Live playground

Edit the component props and inspect the exact JSX before copying it. The preview loads only when this section enters the viewport.

Generated JSX
<Card
  className="w-full max-w-sm px-6"
>
  <CardHeader>
    <CardTitle>Project health</CardTitle>
    <CardDescription>All quality gates are passing.</CardDescription>
  </CardHeader>
  <CardContent>
    <p
      className="text-sm"
    >The registry and documentation are synchronized.</p>
  </CardContent>
  <CardFooter>
    <button
      type="button"
      className="rounded-md border px-3 py-2 text-sm font-medium"
    >View report</button>
  </CardFooter>
</Card>

API reference

Generated from the public TypeScript exports in src/ui/card.tsx.

View JSON

Card

Component
Props: React.ComponentProps<"div">

CardHeader

Component
Props: React.ComponentProps<"div">

CardFooter

Component
Props: React.ComponentProps<"div">

CardTitle

Component
Props: React.ComponentProps<"div">

CardAction

Component
Props: React.ComponentProps<"div">

CardDescription

Component
Props: React.ComponentProps<"div">

CardContent

Component
Props: React.ComponentProps<"div">

Accessibility contract

Machine-readable behavior and consumer responsibilities for card.

View JSON
Support
Composition contract
Pattern
content group
HTML div

Built-in semantics

  • Does not impose a role; headings, descriptions and actions retain their native semantics.

Consumer responsibilities

  • Use a heading for the title and add a labelled region only when the card needs to be a navigation landmark.