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
Dashboard cards
Insight Card
A card with a headline number, a label and rows of detail.
import { InsightCard, InsightRow } from "@/registry/vcare/ui/insight-card"
export default function InsightCardDemo() {
return (
<InsightCard className="mx-auto max-w-sm" label="Average wait" value="14" unit="min">
<InsightRow>
<span className="text-muted-foreground">General medicine</span>
<span className="tabular-nums">18 min</span>
</InsightRow>
<InsightRow>
<span className="text-muted-foreground">Lab</span>
<span className="tabular-nums">9 min</span>
</InsightRow>
</InsightCard>
)
}Installation
npx shadcn@latest add @vcare/insight-cardOr install directly from the URL: https://ui.vcarehms.com/r/insight-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/insight-card.tsx
import * as React from 'react';
import { cn } from '@/registry/vcare/lib/utils';
interface Props extends Omit<React.ComponentProps<'section'>, 'title'> {
/** Small muted line above the headline, e.g. "Monday" or "Sleep score". */
label?: React.ReactNode;
/** Headline number or word. */
value?: React.ReactNode;
/** Muted unit that sits on the headline's baseline, e.g. "steps". */
unit?: React.ReactNode;
/** Top-right control, usually a `RangeSwitcher` or `PeriodTabs`. */
action?: React.ReactNode;
}
/** The tray every health and chart card sits on: label, big number with a small unit, a control at the top right, then content. */
export function InsightCard({ label, value, unit, action, className, children, ...props }: Props) {
return (
<section
data-slot="insight-card"
className={cn('flex min-w-0 flex-col gap-4 rounded-3xl border bg-card p-5 text-card-foreground', className)}
{...props}
>
{(label || value !== undefined || action) && (
<header className="flex flex-wrap items-start justify-between gap-x-3 gap-y-2">
<div className="min-w-0">
{label && <p className="text-sm text-muted-foreground">{label}</p>}
{value !== undefined && (
<p className="mt-1 flex items-baseline gap-1.5">
<span className="text-2xl font-medium tracking-tight tabular-nums">{value}</span>
{unit && <span className="text-sm text-muted-foreground">{unit}</span>}
</p>
)}
</div>
{action && <div className="shrink-0">{action}</div>}
</header>
)}
{children}
</section>
);
}
/** A white inner row on the tray: label on the left, value on the right. */
export function InsightRow({ className, ...props }: React.ComponentProps<'div'>) {
return (
<div
data-slot="insight-row"
className={cn('flex items-center justify-between gap-3 rounded-xl bg-secondary px-3 py-2.5 text-sm', className)}
{...props}
/>
);
}Usage
import { InsightCard, InsightRow } from "@/components/ui/insight-card"Exports
InsightCard, InsightRow
Dependencies
@vcare/utils(registry)
Raw item: /r/insight-card.json