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
Checkbox
A box that toggles between checked and unchecked.
import { Checkbox } from "@/registry/vcare/ui/checkbox"
import { Label } from "@/registry/vcare/ui/label"
export default function CheckboxDemo() {
return (
<div className="grid gap-3">
{["Fasting sample", "Home collection", "Send report on WhatsApp"].map((t, i) => (
<div key={t} className="flex items-center gap-2">
<Checkbox id={`c${i}`} defaultChecked={i === 0} />
<Label htmlFor={`c${i}`}>{t}</Label>
</div>
))}
</div>
)
}Installation
npx shadcn@latest add @vcare/checkboxOr install directly from the URL: https://ui.vcarehms.com/r/checkbox.json
- Install the dependencies:
npm i lucide-react radix-ui - 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/checkbox.tsx
'use client';
import * as React from 'react';
import { cn } from '@/registry/vcare/lib/utils';
import { CheckIcon } from 'lucide-react';
import { Checkbox as CheckboxPrimitive } from 'radix-ui';
function Checkbox({
className,
indeterminate,
...props
}: React.ComponentProps<typeof CheckboxPrimitive.Root> & {
indeterminate?: boolean;
}) {
return (
<CheckboxPrimitive.Root
data-slot="checkbox"
{...(indeterminate ? { checked: 'indeterminate' as const } : {})}
className={cn(
'peer size-4 shrink-0 rounded-[4px] border border-line-strong transition-[background-color,border-color,box-shadow] duration-150 ease-power3-out outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground',
className,
)}
{...props}
>
<CheckboxPrimitive.Indicator data-slot="checkbox-indicator" className="grid place-content-center text-current transition-none">
<CheckIcon className="size-3" strokeWidth={3} />
</CheckboxPrimitive.Indicator>
</CheckboxPrimitive.Root>
);
}
export { Checkbox };Usage
import { Checkbox } from "@/components/ui/checkbox"Exports
Checkbox
Dependencies
lucide-react@^1.80.0(npm)radix-ui@^1.8.1(npm)@vcare/utils(registry)
Raw item: /r/checkbox.json