Card
uiable/cardFreeComponent
Card component.
Live preview
live · rendered by the registry
Rendered by uiable on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://uiable.com/r/card.jsonSource
1import { ComponentProps } from "react";23import { cn } from "@/lib/utils";45function Card({6 className,7 size = "default",8 ...props9}: ComponentProps<"div"> & { size?: "default" | "sm" }) {10 return (11 <div12 data-slot="card"13 data-size={size}14 className={cn(15 "group/card rounded-lg border relative border-border mb-6 bg-card",16 className17 )}18 {...props}19 />20 );21}2223function CardHeader({ className, ...props }: ComponentProps<"div">) {24 return (25 <div26 data-slot="card-header"27 className={cn(28 "p-[25px] border-b border-border group-data-[size=sm]/card:p-4",29 className30 )}31 {...props}32 />33 );34}3536function CardTitle({ className, ...props }: ComponentProps<"div">) {37 return (38 <div39 data-slot="card-title"40 className={cn("h5 font-semibold", className)}41 {...props}42 />43 );44}4546function CardDescription({ className, ...props }: ComponentProps<"div">) {47 return (48 <div49 data-slot="card-description"50 className={cn("text-muted-foreground text-sm", className)}51 {...props}52 />53 );54}5556function CardAction({ className, ...props }: ComponentProps<"div">) {57 return (58 <div59 data-slot="card-action"60 className={cn(61 "col-start-2 row-span-2 row-start-1 self-start justify-self-end",62 className63 )}64 {...props}65 />66 );67}6869function CardContent({ className, ...props }: ComponentProps<"div">) {70 return (71 <div72 data-slot="card-content"73 className={cn("p-[25px] group-data-[size=sm]/card:p-4", className)}74 {...props}75 />76 );77}7879function CardFooter({ className, ...props }: ComponentProps<"div">) {80 return (81 <div82 data-slot="card-footer"83 className={cn(84 "px-6.25 py-4 border-t border-border group-data-[size=sm]/card:px-4",85 className86 )}87 {...props}88 />89 );90}9192export {93 Card,94 CardHeader,95 CardFooter,96 CardTitle,97 CardAction,98 CardDescription,99 CardContent100};
Files it writes
More from uiable
All 712 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | uiable | Components | Free | 2 deps | |
| Alertalert | uiable | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | uiable | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | uiable | Components | Free | no deps | |
| Attachmentattachment | uiable | Components | Free | 2 deps | |
| Avataravatar | uiable | Components | Free | 1 dep | |
| Badgebadge | uiable | Components | Free | 2 deps | |
| Breadcrumbbreadcrumb | uiable | Components | Free | 2 deps |
