Card
tdds/cardFreeComponent
Card component with Treasury border styling
Install it
npx shadcn@latest add https://raw.githubusercontent.com/gjohnsx/ttb-label-verification/main/tdds-registry/public/r/card.jsonSource
1import * as React from "react"23import { cn } from "@/lib/utils"45function Card({6 className,7 size = "default",8 ...props9}: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {10 return (11 <div12 data-slot="card"13 data-size={size}14 className={cn("border border-treasury-base-darkest bg-card text-card-foreground gap-6 overflow-hidden py-6 text-sm has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 group/card flex flex-col", className)}15 {...props}16 />17 )18}1920function CardHeader({ className, ...props }: React.ComponentProps<"div">) {21 return (22 <div23 data-slot="card-header"24 className={cn(25 "gap-1 px-6 group-data-[size=sm]/card:px-4 [.border-b]:pb-6 group-data-[size=sm]/card:[.border-b]:pb-4 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",26 className27 )}28 {...props}29 />30 )31}3233function CardTitle({ className, ...props }: React.ComponentProps<"div">) {34 return (35 <div36 data-slot="card-title"37 className={cn("text-base leading-normal font-medium group-data-[size=sm]/card:text-sm", className)}38 {...props}39 />40 )41}4243function CardDescription({ className, ...props }: React.ComponentProps<"div">) {44 return (45 <div46 data-slot="card-description"47 className={cn("text-muted-foreground text-sm", className)}48 {...props}49 />50 )51}5253function CardAction({ className, ...props }: React.ComponentProps<"div">) {54 return (55 <div56 data-slot="card-action"57 className={cn(58 "col-start-2 row-span-2 row-start-1 self-start justify-self-end",59 className60 )}61 {...props}62 />63 )64}6566function CardContent({ className, ...props }: React.ComponentProps<"div">) {67 return (68 <div69 data-slot="card-content"70 className={cn("px-6 group-data-[size=sm]/card:px-4", className)}71 {...props}72 />73 )74}7576function CardFooter({ className, ...props }: React.ComponentProps<"div">) {77 return (78 <div79 data-slot="card-footer"80 className={cn("px-6 group-data-[size=sm]/card:px-4 [.border-t]:pt-6 group-data-[size=sm]/card:[.border-t]:pt-4 flex items-center", className)}81 {...props}82 />83 )84}8586export {87 Card,88 CardHeader,89 CardFooter,90 CardTitle,91 CardAction,92 CardDescription,93 CardContent,94}
What it pulls in
Other registry items
Files it writes
More from tdds
All 43 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | tdds | Components | Free | 2 deps | |
| Alertalert | tdds | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | tdds | Components | Free | 1 dep | |
| Avataravatar | tdds | Components | Free | 1 dep | |
| Badgebadge | tdds | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | tdds | Components | Free | 2 deps | |
| Buttonbutton | tdds | Components | Free | 2 deps | |
| Button Groupbutton-group | tdds | Components | Free | 1 dep |
