Card
uifoundry/cardFreeComponent
Card component with header, content, footer, title, description, and action slots
Live preview
live · rendered by the registry
Rendered by uifoundry on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://uifoundry.dev/r/card.jsonSource
1import * as React from "react";23import { cn } from "@/registry/default/utils";45function Card({ className, ...props }: React.ComponentProps<"div">) {6 return (7 <div8 className={cn(9 "bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",10 className,11 )}12 data-slot="card"13 {...props}14 />15 );16}1718function CardAction({ className, ...props }: React.ComponentProps<"div">) {19 return (20 <div21 className={cn(22 "col-start-2 row-span-2 row-start-1 self-start justify-self-end",23 className,24 )}25 data-slot="card-action"26 {...props}27 />28 );29}3031function CardContent({ className, ...props }: React.ComponentProps<"div">) {32 return (33 <div34 className={cn("px-6", className)}35 data-slot="card-content"36 {...props}37 />38 );39}4041function CardDescription({ className, ...props }: React.ComponentProps<"div">) {42 return (43 <div44 className={cn("text-muted-foreground text-sm", className)}45 data-slot="card-description"46 {...props}47 />48 );49}5051function CardFooter({ className, ...props }: React.ComponentProps<"div">) {52 return (53 <div54 className={cn("flex items-center px-6 [.border-t]:pt-6", className)}55 data-slot="card-footer"56 {...props}57 />58 );59}6061function CardHeader({ className, ...props }: React.ComponentProps<"div">) {62 return (63 <div64 className={cn(65 "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",66 className,67 )}68 data-slot="card-header"69 {...props}70 />71 );72}7374function CardTitle({ className, ...props }: React.ComponentProps<"div">) {75 return (76 <div77 className={cn("leading-none font-semibold", className)}78 data-slot="card-title"79 {...props}80 />81 );82}8384export {85 Card,86 CardAction,87 CardContent,88 CardDescription,89 CardFooter,90 CardHeader,91 CardTitle,92};
What it pulls in
npm packages
Other registry items
Files it writes
More from uifoundry
All 54 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Groupanimated-group | uifoundry | Components | Free | 2 deps | |
| Buttonbutton | uifoundry | Components | Free | 3 deps | |
| Call To Action Pair Fieldcall-to-action-pair-field | uifoundry | Components | Free | 3 deps | |
| Description Fielddescription-field | uifoundry | Components | Free | 2 deps | |
| Flickering Gridflickering-grid | uifoundry | Components | Free | 1 dep | |
| Header Fieldheader-field | uifoundry | Components | Free | 2 deps | |
| Icon Componenticon | uifoundry | Components | Free | 2 deps | |
| Render Blocksrenderblocks | uifoundry | Components | Free | 2 deps |
