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
Bar Card
"Visits this week": a headline number with a change badge and seven bars that grow into view.
import { BarCard } from "@/registry/vcare/site/widgets/bar-card"
export default function SiteBarCardDemo() {
// 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-[250px]">
<BarCard />
</div>
</div>
)
}Installation
npx shadcn@latest add @vcare/site-bar-cardOr install directly from the URL: https://ui.vcarehms.com/r/site-bar-card.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/bar-card.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]';
/** "Visits this week": a headline number with a change badge and seven bars that grow into view. */
export function BarCard({ title = 'Visits this week', value = '1,284', delta = '+12%' }: { title?: string; value?: string; delta?: string }) {
const bars = [62, 34, 28, 82, 94, 70, 46];
return (
<div className={`${card} h-full`}>
<div className="flex items-start justify-between"><div><p className="text-[12px] text-[#6b7280]">{title}</p><p className="mt-1 flex items-center gap-2 text-[22px] font-semibold text-ink">{value}<Badge tone="green">{delta}</Badge></p></div><span className="rounded-lg bg-[#f4f5f7] px-2 py-1 text-[11px] font-medium text-[#4b5160]">This week</span></div>
<div className="mt-4 flex h-[130px] items-end gap-2">
{bars.map((h, i) => (
<div key={i} className="relative h-full flex-1 overflow-hidden rounded-lg bg-[#f1f3f6]">
<motion.div className="absolute inset-x-0 bottom-0 rounded-lg bg-[#16b8a6]" initial={{ height: 0 }} whileInView={{ height: `${h}%` }} viewport={{ once: true }} transition={{ duration: 0.9, delay: 0.2 + i * 0.07, ease: [0.25, 1, 0.5, 1] }} />
</div>
))}
</div>
<div className="mt-2 flex gap-2 text-center text-[10px] text-[#9aa0ad]">{['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'].map((d) => <span key={d} className="flex-1">{d}</span>)}</div>
</div>
);
}Usage
import { BarCard } from "@/components/site/widgets/bar-card"Exports
BarCard
Dependencies
motion@^14.14.0(npm)@vcare/site-kit(registry)@vcare/site-theme(registry)
Raw item: /r/site-bar-card.json