{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "base-checkbox", "type": "registry:ui", "title": "Base Checkbox", "description": "An easily stylable checkbox component.", "dependencies": [ "motion", "@base-ui-components/react" ], "files": [ { "path": "registry/base/checkbox/index.tsx", "content": "'use client';\n\nimport * as React from 'react';\nimport { Checkbox as CheckboxPrimitive } from '@base-ui-components/react/checkbox';\nimport { type HTMLMotionProps, motion } from 'motion/react';\n\nimport { cn } from '@/lib/utils';\n\ntype CheckboxProps = Omit<\n React.ComponentProps,\n 'render'\n> & {\n motionProps?: HTMLMotionProps<'button'>;\n};\n\nfunction Checkbox({\n className,\n onCheckedChange,\n motionProps,\n ...props\n}: CheckboxProps) {\n const [isChecked, setIsChecked] = React.useState(\n props?.checked ?? props?.defaultChecked ?? false,\n );\n\n React.useEffect(() => {\n if (props?.checked !== undefined) setIsChecked(props.checked);\n }, [props?.checked]);\n\n const handleCheckedChange = React.useCallback(\n (checked: boolean, event: Event) => {\n setIsChecked(checked);\n onCheckedChange?.(checked, event);\n },\n [onCheckedChange],\n );\n\n return (\n \n }\n >\n \n \n \n \n \n \n );\n}\n\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox, type CheckboxProps };\n", "type": "registry:ui", "target": "components/animate-ui/base/checkbox.tsx" } ] }