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
Website widgets
Heatmap
Bed occupancy by hour as a heatmap, with occupancy, free, cleaning and waiting counts.
import { Heatmap } from "@/registry/vcare/site/widgets/heatmap"
export default function SiteHeatmapDemo() {
// Sized as on the website: the widget fills the box it is given.
return (
<div className="vc-site grid place-items-center overflow-x-auto rounded-2xl bg-[#f5f6f8] p-6">
<div className="h-[270px] w-full max-w-[520px]">
<Heatmap />
</div>
</div>
)
}Installation
npx shadcn@latest add @vcare/site-heatmapOr install directly from the URL: https://ui.vcarehms.com/r/site-heatmap.json
- Install the dependencies:
npm i motion - Add the registry items it uses: site-kit, site-theme.
- Copy this file into your project and change the
@/registry/vcare/…imports to your own paths.
components/site/widgets/heatmap.tsx
import { motion } from 'motion/react';
import { Badge } from '../ui/kit';
const card = 'rounded-2xl bg-white p-4 text-left shadow-[0_1px_2px_rgb(15_27_45/0.04),0_10px_28px_-10px_rgb(15_27_45/0.14)] ring-1 ring-black/[0.06]';
/** Bed occupancy by hour as a heatmap, with occupancy, free, cleaning and waiting counts. */
export function Heatmap() {
const shade = ['#eef0fb', '#d7dcf8', '#b7c0f3', '#8e9bec', '#5f6fe0'];
return (
<div className={`${card} h-full`}>
<div className="flex items-center gap-2"><p className="text-[13px] font-semibold text-ink">Bed occupancy by hour</p><Badge tone="green">Healthy</Badge></div>
<div className="mt-3 grid grid-cols-4 gap-2">{[['18%', 'Occupancy'], ['10', 'Free beds'], ['3', 'Cleaning'], ['1', 'Waiting']].map(([v, l]) => <div key={l} className="rounded-lg bg-[#f7f7f9] px-3 py-2"><p className="text-[15px] font-semibold text-ink">{v}</p><p className="text-[10.5px] text-[#6b7280]">{l}</p></div>)}</div>
<div className="mt-3 grid grid-cols-[repeat(24,1fr)] gap-1.5">
{Array.from({ length: 144 }, (_, i) => <motion.i key={i} className="aspect-square rounded-full" style={{ background: shade[(i * 7 + (i % 5) * 3 + Math.floor(i / 24) * 2) % 5] }} initial={{ opacity: 0, scale: 0.6 }} whileInView={{ opacity: 1, scale: 1 }} viewport={{ once: true }} transition={{ delay: (i % 24) * 0.015, duration: 0.4 }} />)}
</div>
</div>
);
}Usage
import { Heatmap } from "@/components/site/widgets/heatmap"Exports
Heatmap
Dependencies
motion@^14.14.0(npm)@vcare/site-kit(registry)@vcare/site-theme(registry)
Raw item: /r/site-heatmap.json