card
lyse/cardFreeComponent
lyse publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by lyse on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.getlyse.com/r/card.jsonSource
1import * as React from "react"2import { cva, type VariantProps } from "class-variance-authority"34import { cn } from "@/lib/utils"5import "./card.css"67const cardVariants = cva(8 "card-base flex flex-col gap-[var(--layout-gap-xl)] p-[var(--layout-padding-xl)] rounded-[var(--layout-radius-xl)]",9 {10 variants: {11 variant: {12 outline: "card-outline",13 ghost: "card-ghost",14 },15 },16 defaultVariants: {17 variant: "outline",18 },19 }20)2122function Card({23 className,24 variant,25 ...props26}: React.ComponentProps<"div"> & VariantProps<typeof cardVariants>) {27 return (28 <div29 data-slot="card"30 className={cn(cardVariants({ variant, className }))}31 {...props}32 />33 )34}3536function CardHeader({ className, ...props }: React.ComponentProps<"div">) {37 return (38 <div39 data-slot="card-header"40 className={cn("flex flex-col gap-[var(--layout-gap-sm)]", className)}41 {...props}42 />43 )44}4546function CardTitle({ className, ...props }: React.ComponentProps<"h3">) {47 return (48 <h349 data-slot="card-title"50 className={cn("text-heading-small font-bold", className)}51 {...props}52 />53 )54}5556function CardDescription({ className, ...props }: React.ComponentProps<"p">) {57 return (58 <p59 data-slot="card-description"60 className={cn("text-content-note", className)}61 {...props}62 />63 )64}6566function CardContent({ className, ...props }: React.ComponentProps<"div">) {67 return (68 <div69 data-slot="card-content"70 className={cn(className)}71 {...props}72 />73 )74}7576function CardFooter({ className, ...props }: React.ComponentProps<"div">) {77 return (78 <div79 data-slot="card-footer"80 className={cn(81 "flex items-center gap-[var(--layout-gap-md)]",82 className83 )}84 {...props}85 />86 )87}8889export {90 Card,91 CardHeader,92 CardFooter,93 CardTitle,94 CardDescription,95 CardContent,96 cardVariants,97}
What it pulls in
npm packages
Other registry items
Files it writes
More from lyse
All 33 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| action-cardaction-card | lyse | Components | Free | no deps · 2 files | |
| alertalert | lyse | Components | Free | 2 deps · 2 files | |
| alert-dialogalert-dialog | lyse | Components | Free | 2 deps · 2 files | |
| avataravatar | lyse | Components | Free | 3 deps · 2 files | |
| badgebadge | lyse | Components | Free | 1 dep · 2 files | |
| banner-infobanner-info | lyse | Components | Free | 2 deps · 2 files | |
| breadcrumbbreadcrumb | lyse | Components | Free | 2 deps · 2 files | |
| buttonbutton | lyse | Components | Free | 2 deps · 2 files |
