Documentation menu
Getting Started
Components
Primitives
- Agent Thinking
- Alert
- Alert Dialog
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Checkbox
- Command
- Command Palette
- Context Menu
- Data Table
- Dialog
- Dropdown Menu
- Empty
- Field
- Glow Cloud
- Input
- Label
- Medication Schedule
- Period Tabs
- Popover
- Rainbow Button
- Scroll Area
- Select
- Selectable Card
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Tag
- Textarea
- Timeline
- Tooltip
- Use Count Up
Charts and metrics
Patterns
- Confirm Button
- Date Picker
- Embedded
- Empty State
- Entity Drawer
- Error Boundary
- Field Row
- File Dropzone
- Form Dialog
- Kv
- List Editor
- List Page
- Live Time
- Mini Table
- Money
- Note Field
- Note Text
- Page Card
- Page Header
- Page Tabs
- Page Toolbar
- Person Cell
- Picture Field
- Print Card
- Range Switcher
- Row Actions
- Search Input
- Search Select
- Selected Box
- Signature Pad
- Status Badge
- Sub Nav Layout
- Suggest Input
- Tab Icons
- Table Footer
- Theme Accent Picker
- Time Picker
- View All Link
Dashboard cards
Advanced
Device frames
Website widgets
Website screens
Website panels
Primitives
Card
A surface that groups related content, with header, action and footer slots.
import { MoreHorizontal } from "lucide-react"
import { Button } from "@/registry/vcare/ui/button"
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/registry/vcare/ui/card"
export default function CardDemo() {
return (
<Card className="mx-auto w-full max-w-sm">
<CardHeader>
<CardTitle>Meera Raghavan</CardTitle>
<CardDescription>MRN 00482 · 34 years · Female</CardDescription>
<CardAction>
<Button size="icon-sm" variant="ghost" aria-label="More"><MoreHorizontal /></Button>
</CardAction>
</CardHeader>
<CardContent className="text-sm text-muted-foreground">Follow up for thyroid profile. Last visit 12 days ago.</CardContent>
<CardFooter className="gap-2">
<Button size="sm">Start visit</Button>
<Button size="sm" variant="outline">History</Button>
</CardFooter>
</Card>
)
}Installation
npx shadcn@latest add @vcare/cardOr install directly from the URL: https://ui.vcarehms.com/r/card.json
- Add the registry items it uses: utils.
- Copy this file into your project and change the
@/registry/vcare/…imports to your own paths.
components/ui/card.tsx
import * as React from 'react';
import { cn } from '@/registry/vcare/lib/utils';
function Card({ className, ...props }: React.ComponentProps<'div'>) {
return (
<div data-slot="card" className={cn('flex flex-col gap-5 rounded-2xl border bg-card py-5 text-card-foreground shadow-card', className)} {...props} />
);
}
function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
return (
<div
data-slot="card-header"
className={cn(
'@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',
className,
)}
{...props}
/>
);
}
function CardTitle({ className, ...props }: React.ComponentProps<'div'>) {
return <div data-slot="card-title" className={cn('leading-none font-semibold', className)} {...props} />;
}
function CardDescription({ className, ...props }: React.ComponentProps<'div'>) {
return <div data-slot="card-description" className={cn('text-sm text-muted-foreground', className)} {...props} />;
}
function CardAction({ className, ...props }: React.ComponentProps<'div'>) {
return <div data-slot="card-action" className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)} {...props} />;
}
function CardContent({ className, ...props }: React.ComponentProps<'div'>) {
return <div data-slot="card-content" className={cn('px-6', className)} {...props} />;
}
function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
return <div data-slot="card-footer" className={cn('flex items-center px-6 [.border-t]:pt-6', className)} {...props} />;
}
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };Usage
import { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription } from "@/components/ui/card"Exports
Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent
Dependencies
@vcare/utils(registry)
Raw item: /r/card.json