Shadcn Card Components

Displays a card with header, content, and footer. Every card layout can be used alongside Radix UI and Base UI components. Browse our collection of 9 Shadcn Card variants.

Upgrade to Pro
Unlock advanced automation, analytics, and priority support designed for SaaS teams to scale faster, optimize operations, and deliver a world-class experience to your users.

With form

Login to your account
Enter your email below to login to your account
Don't have an account? Sign up

With top image

Blog banner
How to Create Stunning Gradients for Your Website
Discover pro techniques for blending colors and adding dynamic swirls to your backgrounds with simple CSS tricks.

With action

Need a help in Claim?
Go to this step by step guideline process on how to certify for your weekly benefits:

With tabs

Get a comprehensive view of your project metrics, recent activity, and key performance indicators. Monitor your progress and stay on top of important updates.

Meeting Notes
Transcript from the meeting with the client.

Client requested dashboard redesign with focus on mobile responsiveness.

  1. New analytics widgets for daily/weekly metrics
  2. Simplified navigation menu
  3. Dark mode support
  4. Timeline: 6 weeks
  5. Follow-up meeting scheduled for next Tuesday
OMINSD

With cookie consent

Cookie Settings
We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies.

Search with empty state

Team Members
Invite your team members to collaborate.
No team members found
We couldn't find any team members matching your search. Try adjusting your filters or invite a new member.

Social profile

Notabli AI - Meeting Notetaker

@notabli.ai

Focus on the Conversation, We'll Take the Notes.

184 Following

98,215 Followers

Unlock premium components
Get full control of shadcn/ui components, blocks and instances, including future additions.

Explore Shadcn Blocks

Ready-made page sections built with the same components.

View all blocks

Shadcn Card Component

The Shadcn Card is a container that groups related content and actions into one surface with a header, a body and a footer. Almost every dashboard, settings page and marketing section is made of cards: pricing plans, login forms, metric tiles, profile previews and blog teasers all share the same structure.

The layouts here are finished building blocks rather than empty boxes: a call to action, a sign up form, a card with a top image, tabbed content, an avatar list, a cookie consent banner and a social profile with search. Under the hood the React card component is plain markup built with shadcn/ui, React and Tailwind CSS, so it works in Radix UI and Base UI projects alike, together with the menus, tabs and inputs placed inside it.

What is the Shadcn Card Component?

A card is a set of styled div elements with named slots: CardHeader holds the title, description and an optional action in the top right corner, CardContent holds the body and CardFooter holds buttons or meta information. Spacing is controlled by one CSS variable, so the padding between the slots stays consistent, and a size="sm" option makes a more compact card.

Use a card when content belongs together and should read as one unit on a page. It is not an overlay: if the content should appear on top of the page and block it, use an Alert Dialog or a Sheet. For a row in a list with an icon, text and actions, the lighter Item component is often a better fit than a full card.

Anatomy of the Shadcn Card

PartDescription
CardThe root container with background, rounded corners, ring and shadow. Accepts size="default" or "sm" to change the inner spacing.
CardHeaderThe top area. It is a grid that places the title and description on the left and switches to two columns when a CardAction is present.
CardTitleThe heading text of the card. It renders a div, so place a heading element inside when the page outline needs one.
CardDescriptionMuted supporting text shown under the title.
CardActionAn area pinned to the top right of the header for a menu button, a badge or a link.
CardContentThe main body. Holds forms, lists, charts, images or any other content with the card's horizontal padding.
CardFooterThe bottom row, a flex container for buttons, links, avatars or totals.

9 Shadcn Card Variants

Each card variant listed here is previewed live at the top of this page, together with its source code and install command.

  • Call to action: A title, a short description and a full width button in the footer, suited to upgrade and pricing prompts.
  • With form: A login card with email and password fields, a forgot password link and primary plus social sign in buttons.
  • With top image: An edge to edge cover image above a blog style title, description, read more button and share icon.
  • With action: Uses CardAction to place a dropdown menu button in the top right corner of the header.
  • With tabs: Line style tabs across the top of the card that switch the content below without leaving the page.
  • Content with avatars: Meeting notes with a numbered list in the body and a stack of attendee avatars in the footer.
  • Cookie consent: A compact notice with Reject and Accept All buttons aligned to the right of the footer.
  • Search and social profile: A team search card with an input group, an empty state and an invite button, and a social profile card with a cover banner, a round logo, a follow button and follower stats.

How to Install the Shadcn Card Component

Set up shadcn/ui in your project if you have not already, then add the Shadcn UI Kit registry to your components.json once:

{
  "registries": {
    "@shadcnuikit": "https://shadcnuikit.com/r/{name}.json"
  }
}

Then install a card variant by its name:

npx shadcn@latest add @shadcnuikit/card1

The same command works with pnpm dlx, yarn dlx and bunx --bun. Each variant has a copy button for every package manager, and the code is added to your project as plain React and Tailwind CSS that you can edit freely.

How to Use the Shadcn Card Component

Import the parts you need from your components/ui folder. Every part is optional, so a card can be as small as a title and a button.

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

export function RevenueCard() {
  return (
    <Card className="w-full max-w-sm">
      <CardHeader>
        <CardTitle>Monthly revenue</CardTitle>
        <CardDescription>Compared to last month</CardDescription>
        <CardAction>
          <Button variant="ghost" size="sm">
            Export
          </Button>
        </CardAction>
      </CardHeader>
      <CardContent>
        <p className="text-3xl font-semibold">$48,290</p>
      </CardContent>
      <CardFooter>
        <Button className="w-full">View report</Button>
      </CardFooter>
    </Card>
  )
}

Why Use the Shadcn Card Component

  • Consistent structure: Header, content and footer slots keep spacing and alignment the same across every card in the app.
  • Built-in action slot: CardAction places a menu or button in the header without extra flex or grid code.
  • One spacing variable: Padding and gaps come from a single --card-spacing value, and size="sm" makes a compact card.
  • Server friendly: The card has no state or client logic, so it renders in React Server Components.
  • Works with everything: Forms, tabs, charts, tables and images fit inside without special wrappers.

Common Card Use Cases

  • Dashboard metrics: KPI tiles, charts and recent activity panels in admin dashboards.
  • Authentication: Login, sign up and password reset forms centered on the page.
  • Pricing plans: Plan name, price, feature list and a call to action button.
  • Content previews: Blog posts, products and projects with a cover image and short summary.
  • Settings sections: Group related settings with a title, description and a save button in the footer.
  • Profiles and teams: User profiles, team member lists and follower stats.

Customizing the Shadcn Card

Every part accepts className. Remove the shadow with shadow-none, add a divider under the header with border-b (the header then adds bottom padding for you) or change the spacing for one card by overriding the --card-spacing variable. An image placed as the first child loses the top padding and gets rounded corners automatically. Colors use the card and card-foreground tokens, which you can adjust with the free Theme Generator.

For example, a flat card with a separated header and footer:

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

export function FlatCard() {
  return (
    <Card className="shadow-none">
      <CardHeader className="border-b">
        <CardTitle>Billing</CardTitle>
      </CardHeader>
      <CardContent>Your plan renews on May 1.</CardContent>
      <CardFooter className="border-t">Manage plan</CardFooter>
    </Card>
  )
}

Card Accessibility

A card is a visual grouping, not an ARIA widget, so it has no keyboard behavior of its own. Focus moves through the buttons, links and inputs inside it in the normal tab order. CardTitle renders a div, so when cards form sections of a page, put an h2 or h3 inside the title to keep a correct heading outline for screen reader users.

If the whole card should be clickable, avoid wrapping it in a single link that contains other buttons. Instead, make the title a link and stretch its click area with a pseudo element, so nested actions stay reachable and the link text stays short and meaningful.

Card Best Practices

  • Keep one primary action per card; secondary actions go in CardAction or an outline button.
  • Use the same card structure for items in a grid so titles, content and buttons line up.
  • Do not nest cards inside cards; use a Separator or a muted background to divide content instead.
  • Put the most important value, such as a price or metric, in the content area where it gets the most space.
  • Give images in cards meaningful alt text, or an empty alt when they are decorative.
  • For repeated list rows, consider the lighter Item component instead of many small cards.

Components Related to Card

Shadcn Card FAQ

Place a CardAction inside CardHeader after the title and description. The header switches to a two column grid and pins the action to the top right, which is ideal for a menu button or badge.

Add shadow-none to the Card to remove the shadow. For padding, set py-0 on the Card and px-0 on CardContent, or override the --card-spacing variable to change all card spacing at once.

Pass size="sm" to Card. It reduces the --card-spacing value, so the padding and the gaps between header, content and footer become smaller together.

Put the image as the first child of the Card. The card removes its top padding and rounds the image corners automatically. You can also wrap the image in CardContent with px-0 and add pt-0 to the Card, as the top image variant on this page does.

Wrap the Card in Tabs, place a TabsList in a bordered header area at the top of the card and render one TabsContent per tab inside CardContent. Set gap-0 and py-0 on the Card so the tab bar sits flush with the edges, as the With tabs variant on this page does.

Looking for something else? Browse all shadcn/ui components or ready-made UI blocks built with them.