Card
boldkit/cardFreeComponent
Displays a card with header, content, and footer with thick borders and shadows
Live preview
live · rendered by the registry
Rendered by boldkit on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://boldkit.dev/r/card.jsonSource
1import * as React from 'react'2import { cn } from '@/lib/utils'34const Card = React.forwardRef<5 HTMLDivElement,6 React.HTMLAttributes<HTMLDivElement> & { interactive?: boolean }7>(({ className, interactive, role = 'article', ...props }, ref) => (8 <div9 ref={ref}10 role={role}11 className={cn(12 'bg-card text-card-foreground border-3 border-foreground shadow-[4px_4px_0px_hsl(var(--shadow-color))] bk-interactive',13 interactive && 'cursor-pointer hover:translate-x-[4px] hover:translate-y-[4px] hover:shadow-none active:translate-x-[4px] active:translate-y-[4px] active:shadow-none',14 className15 )}16 {...props}17 />18))19Card.displayName = 'Card'2021const CardHeader = React.forwardRef<22 HTMLDivElement,23 React.HTMLAttributes<HTMLDivElement>24>(({ className, ...props }, ref) => (25 <div26 ref={ref}27 className={cn('flex flex-col space-y-1.5 p-6 border-b-3 border-foreground', className)}28 {...props}29 />30))31CardHeader.displayName = 'CardHeader'3233const CardTitle = React.forwardRef<34 HTMLHeadingElement,35 React.HTMLAttributes<HTMLHeadingElement>36>(({ className, ...props }, ref) => (37 <h338 ref={ref}39 className={cn('text-xl font-bold uppercase tracking-wide leading-none', className)}40 {...props}41 />42))43CardTitle.displayName = 'CardTitle'4445const CardDescription = React.forwardRef<46 HTMLDivElement,47 React.HTMLAttributes<HTMLDivElement>48>(({ className, ...props }, ref) => (49 <div50 ref={ref}51 className={cn('text-sm text-muted-foreground', className)}52 {...props}53 />54))55CardDescription.displayName = 'CardDescription'5657const CardContent = React.forwardRef<58 HTMLDivElement,59 React.HTMLAttributes<HTMLDivElement>60>(({ className, ...props }, ref) => (61 <div ref={ref} className={cn('p-6', className)} {...props} />62))63CardContent.displayName = 'CardContent'6465const CardFooter = React.forwardRef<66 HTMLDivElement,67 React.HTMLAttributes<HTMLDivElement>68>(({ className, ...props }, ref) => (69 <div70 ref={ref}71 className={cn('flex items-center p-6 border-t-3 border-foreground bg-muted/50', className)}72 {...props}73 />74))75CardFooter.displayName = 'CardFooter'7677export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
What it pulls in
Other registry items
Files it writes
More from boldkit
All 94 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | boldkit | Components | Free | 2 deps | |
| Alertalert | boldkit | Components | Free | 2 deps | |
| Alert Dialogalert-dialog | boldkit | Components | Free | 1 dep | |
| ASCII Shapesascii-shapes | boldkit | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | boldkit | Components | Free | 1 dep | |
| Avataravatar | boldkit | Components | Free | 1 dep | |
| Badgebadge | boldkit | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | boldkit | Components | Free | 2 deps |
