Card
scificn/cardFreeComponent
Surface container with header, content, and footer sections.
Live preview
live · rendered by the registry
Rendered by scificn on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.scificn.dev/r/card.jsonSource
1import * as React from 'react'2import { cn } from '@/lib/utils'34const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(5 ({ className, ...props }, ref) => (6 <div7 ref={ref}8 className={cn(9 'bg-[var(--surface)] border border-[var(--border)]',10 'text-[var(--text-secondary)] font-mono',11 className12 )}13 {...props}14 />15 )16)17Card.displayName = 'Card'1819const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(20 ({ className, ...props }, ref) => (21 <div22 ref={ref}23 className={cn('flex flex-col gap-1.5 p-4 border-b border-[var(--border)]', className)}24 {...props}25 />26 )27)28CardHeader.displayName = 'CardHeader'2930const CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(31 ({ className, ...props }, ref) => (32 <h333 ref={ref}34 className={cn(35 'text-sm font-semibold uppercase tracking-widest text-[var(--color-green)]',36 className37 )}38 {...props}39 />40 )41)42CardTitle.displayName = 'CardTitle'4344const CardDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(45 ({ className, ...props }, ref) => (46 <p47 ref={ref}48 className={cn('text-xs text-[var(--text-muted)]', className)}49 {...props}50 />51 )52)53CardDescription.displayName = 'CardDescription'5455const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(56 ({ className, ...props }, ref) => (57 <div ref={ref} className={cn('p-4', className)} {...props} />58 )59)60CardContent.displayName = 'CardContent'6162const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(63 ({ className, ...props }, ref) => (64 <div65 ref={ref}66 className={cn('flex items-center p-4 border-t border-[var(--border)]', className)}67 {...props}68 />69 )70)71CardFooter.displayName = 'CardFooter'7273export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter }
More from scificn
All 33 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Alertalert | scificn | Components | Free | 1 dep | |
| Badgebadge | scificn | Components | Free | 1 dep | |
| Bar Chartbar-chart | scificn | Components | Free | no deps | |
| Breadcrumbbreadcrumb | scificn | Components | Free | no deps | |
| Buttonbutton | scificn | Components | Free | 2 deps | |
| Checkboxcheckbox | scificn | Components | Free | 1 dep | |
| Dialogdialog | scificn | Components | Free | 1 dep | |
| Gridgrid | scificn | Components | Free | no deps |
