Card
Component
Section titled “Component” Preview react
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"
export function CardDemo() {return ( <Card className="w-[350px]"> <CardHeader> <CardTitle>Card Title</CardTitle> <CardDescription>Card description goes here.</CardDescription> </CardHeader> <CardContent> <p>Card content goes here.</p> </CardContent> <CardFooter> <p>Card footer</p> </CardFooter> </Card>)}Installation
Section titled “Installation”npx shadcn@latest add https://devx-op.github.io/arkitect-ui/r/r/card.jsonpnpm dlx shadcn@latest add https://devx-op.github.io/arkitect-ui/r/r/card.jsonbunx shadcn@latest add https://devx-op.github.io/arkitect-ui/r/r/card.jsonimport { type ComponentProps, forwardRef } from "react"import { cn } from "@/lib/utils"
// Card - main containerconst Card = forwardRef<HTMLDivElement, ComponentProps<"div">>( ({ className, ...props }, ref) => ( <div ref={ref} className={cn( "rounded-xl border bg-card text-card-foreground shadow-sm", className, )} {...props} /> ),)Card.displayName = "Card"
// CardHeaderconst CardHeader = forwardRef<HTMLDivElement, ComponentProps<"div">>( ({ className, ...props }, ref) => ( <div ref={ref} className={cn("flex flex-col space-y-1.5 p-6", className)} {...props} /> ),)CardHeader.displayName = "CardHeader"
// CardTitleconst CardTitle = forwardRef<HTMLHeadingElement, ComponentProps<"h3">>( ({ className, ...props }, ref) => ( <h3 ref={ref} className={cn("font-semibold leading-none tracking-tight", className)} {...props} /> ),)CardTitle.displayName = "CardTitle"
// CardDescriptionconst CardDescription = forwardRef<HTMLParagraphElement, ComponentProps<"p">>( ({ className, ...props }, ref) => ( <p ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} /> ),)CardDescription.displayName = "CardDescription"
// CardContentconst CardContent = forwardRef<HTMLDivElement, ComponentProps<"div">>( ({ className, ...props }, ref) => <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />,)CardContent.displayName = "CardContent"
// CardFooterconst CardFooter = forwardRef<HTMLDivElement, ComponentProps<"div">>( ({ className, ...props }, ref) => ( <div ref={ref} className={cn("flex items-center p-6 pt-0", className)} {...props} /> ),)CardFooter.displayName = "CardFooter"
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle }