{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "checkbox-simple", "type": "registry:ui", "title": "Checkbox Simple", "description": "A simple checkbox component with label and optional description.", "dependencies": [ "motion" ], "files": [ { "path": "registry/ruixenui/checkbox-simple.tsx", "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"@/lib/utils\";\nimport { motion, AnimatePresence } from \"motion/react\";\n\ninterface CheckboxSimpleProps {\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n label?: string;\n description?: string;\n disabled?: boolean;\n id?: string;\n className?: string;\n}\n\nexport function CheckboxSimple({\n checked,\n defaultChecked = false,\n onCheckedChange,\n label,\n description,\n disabled = false,\n id,\n className,\n}: CheckboxSimpleProps) {\n const [internalChecked, setInternalChecked] = React.useState(defaultChecked);\n const isControlled = checked !== undefined;\n const isChecked = isControlled ? checked : internalChecked;\n const inputId = id || React.useId();\n\n const handleChange = (e: React.ChangeEvent) => {\n const newChecked = e.target.checked;\n if (!isControlled) {\n setInternalChecked(newChecked);\n }\n onCheckedChange?.(newChecked);\n };\n\n return (\n \n
\n \n \n \n {isChecked && (\n \n \n \n )}\n \n \n
\n {(label || description) && (\n
\n {label && (\n \n {label}\n \n )}\n {description && (\n \n {description}\n \n )}\n
\n )}\n \n );\n}\n", "type": "registry:ui", "target": "components/ruixen/checkbox-simple.tsx" } ] }