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
Calendar Card
A month calendar with the day's appointment count and coloured booked days.
import { CalendarCard } from "@/registry/vcare/site/widgets/calendar-card"
export default function SiteCalendarCardDemo() {
// 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-[260px] w-full max-w-[520px]">
<CalendarCard />
</div>
</div>
)
}Installation
npx shadcn@latest add @vcare/site-calendar-cardOr install directly from the URL: https://ui.vcarehms.com/r/site-calendar-card.json
- Install the dependencies:
npm i react-icons - Add the registry items it uses: site-theme.
- Copy this file into your project and change the
@/registry/vcare/…imports to your own paths.
components/site/widgets/calendar-card.tsx
import { LuCalendar } from 'react-icons/lu';
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]';
/** A month calendar with the day's appointment count and coloured booked days. */
export function CalendarCard() {
const days = Array.from({ length: 35 }, (_, i) => i - 2);
const busy: Record<number, string> = { 4: '#16b8a6', 7: '#2f6fed', 11: '#e0245e', 13: '#16b8a6', 18: '#8b5cf6', 20: '#2f6fed', 24: '#16b8a6', 27: '#e0245e' };
// The five weeks share whatever height is left, so the card fits any height it is given.
return (
<div className={`${card} flex h-full min-h-[240px] flex-col`}>
<div className="flex items-center justify-between"><div><p className="text-[12px] text-[#6b7280]">Appointments</p><p className="text-[18px] font-semibold text-ink">42 today</p></div><LuCalendar size={16} className="text-[#9aa0ad]" /></div>
<div className="mt-3 grid grid-cols-7 gap-y-2 text-center text-[10.5px] text-[#9aa0ad]">{['M', 'T', 'W', 'T', 'F', 'S', 'S'].map((d, i) => <span key={i}>{d}</span>)}</div>
<div className="mt-1.5 grid min-h-0 flex-1 grid-cols-7 grid-rows-5 gap-y-1">
{days.map((d) => d < 1 || d > 30 ? <span key={d} /> : (
<span key={d} className="grid min-h-0 place-items-center">
<span className="grid h-6 w-6 place-items-center rounded-full text-[10.5px] font-medium text-ink" style={busy[d] ? { background: `${busy[d]}22`, boxShadow: `inset 0 0 0 1.5px ${busy[d]}` } : undefined}>{d}</span>
</span>
))}
</div>
</div>
);
}Usage
import { CalendarCard } from "@/components/site/widgets/calendar-card"Exports
CalendarCard
Dependencies
react-icons@^5.7.0(npm)@vcare/site-theme(registry)
Raw item: /r/site-calendar-card.json