card
amarjay-ui/cardFreeComponent
Container for grouping related content and actions.
Live preview
live · rendered by the registry
Rendered by amarjay-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.amarjay.com/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(15 "group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg bg-card py-(--card-spacing) text-xs/relaxed text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg",16 className17 )}18 {...props}19 />20 )21}2223function CardHeader({ className, ...props }: React.ComponentProps<"div">) {24 return (25 <div26 data-slot="card-header"27 className={cn(28 "group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",29 className30 )}31 {...props}32 />33 )34}3536function CardTitle({ className, ...props }: React.ComponentProps<"div">) {37 return (38 <div39 data-slot="card-title"40 className={cn("font-heading text-sm font-medium", className)}41 {...props}42 />43 )44}4546function CardDescription({ className, ...props }: React.ComponentProps<"div">) {47 return (48 <div49 data-slot="card-description"50 className={cn("text-xs/relaxed text-muted-foreground", className)}51 {...props}52 />53 )54}5556function CardAction({ className, ...props }: React.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 }: React.ComponentProps<"div">) {70 return (71 <div72 data-slot="card-content"73 className={cn("px-(--card-spacing)", className)}74 {...props}75 />76 )77}7879function CardFooter({ className, ...props }: React.ComponentProps<"div">) {80 return (81 <div82 data-slot="card-footer"83 className={cn(84 "flex items-center rounded-b-lg px-(--card-spacing) [.border-t]:pt-(--card-spacing)",85 className86 )}87 {...props}88 />89 )90}9192export {93 Card,94 CardHeader,95 CardFooter,96 CardTitle,97 CardAction,98 CardDescription,99// … truncated
What it pulls in
Other registry items
Files it writes
More from amarjay-ui
All 18 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| alertalert | amarjay-ui | Components | Free | 1 dep | |
| avataravatar | amarjay-ui | Components | Free | 1 dep | |
| badgebadge | amarjay-ui | Components | Free | 2 deps | |
| buttonbutton | amarjay-ui | Components | Free | 2 deps | |
| chartchart | amarjay-ui | Components | Free | 1 dep | |
| context-menucontext-menu | amarjay-ui | Components | Free | 2 deps | |
| dialogdialog | amarjay-ui | Components | Free | 2 deps | |
| dropdown-menudropdown-menu | amarjay-ui | Components | Free | 2 deps |
