{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "dependencies": [
    "@base-ui/react@1.8.0"
  ],
  "description": "A checkbox with a springy tick, indeterminate state and label support.",
  "docs": "Two steps after installing: import the copied stylesheet once at your app entry — it lands at `styles/liquefy-ui.css` — or `@import` it from your global CSS *before* `tailwindcss`, so Tailwind utilities keep winning over component styles. Then wrap the tree in `<LiquefyProvider>`, which is where every component reads its tokens from. Every copied file already carries its own 'use client' directive. Full documentation: https://liquefy-ui.com/#/docs/installation",
  "files": [
    {
      "content": "'use client'\n\nimport { Checkbox } from '@base-ui/react/checkbox'\nimport { forwardRef, useState, type ButtonHTMLAttributes, type ReactNode } from 'react'\nimport { CheckGlyph, MinusGlyph } from '@/lib/internal-glyphs'\nimport { useLiquefyConfig } from '@/lib/provider'\nimport { useLiquidStyles, type LiquidStyleProps } from '@/lib/styles-prop'\nimport { useLiquidGlass } from '@/hooks/use-liquid-glass'\n\n// The hand-rolled version was a `<button role=\"checkbox\">`, which no form ever\n// saw and no `required` ever validated. Base UI keeps the button as the thing\n// you click — the shader canvas needs a box to live in — and puts a real\n// checkbox input beside it.\n\nexport type LiquidCheckboxProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> & LiquidStyleProps & {\n  checked?: boolean\n  defaultChecked?: boolean\n  hint?: string\n  indeterminate?: boolean\n  label?: ReactNode\n  onCheckedChange?: (checked: boolean) => void\n}\n\nexport const LiquidCheckbox = forwardRef<HTMLButtonElement, LiquidCheckboxProps>(({\n  checked,\n  className,\n  defaultChecked = false,\n  disabled,\n  hint,\n  indeterminate = false,\n  label,\n  onCheckedChange,\n  style,\n  styles,\n  ...props\n}, forwardedRef) => {\n  const config = useLiquefyConfig()\n  // The mark has a resting state either way, so the tick should only spring in\n  // once someone has actually ticked it.\n  const [hasInteracted, setHasInteracted] = useState(false)\n  const [elementRef, canvasRef] = useLiquidGlass(forwardedRef, {\n    bounce: 0.08,\n    disabled,\n    glow: config.glow,\n    intensity: config.intensity,\n    lens: config.lens && config.transparency,\n    lensStrength: config.refraction,\n    motion: config.motion,\n    ripple: config.ripple,\n    shimmer: config.shimmer,\n    sparkle: config.sparkle,\n    tilt: 0,\n    tint: config.tint,\n    webgl: config.webgl,\n    wobbliness: config.wobbliness,\n  })\n  // The label is the layout box, so it owns className, style and styles alike.\n  const root = useLiquidStyles('lq-checkbox', { className, style, styles })\n\n  return (\n    <label className={root.className} data-disabled={disabled || undefined} style={root.style}>\n      <Checkbox.Root\n        checked={checked}\n        className=\"lq-checkbox__box\"\n        data-interacted={hasInteracted || undefined}\n        defaultChecked={defaultChecked}\n        disabled={disabled}\n        indeterminate={indeterminate}\n        nativeButton\n        onCheckedChange={(nextChecked) => {\n          setHasInteracted(true)\n          onCheckedChange?.(nextChecked)\n        }}\n        ref={elementRef}\n        render={<button type=\"button\" />}\n        // `render` swaps the span Base UI would have made for a button, but the\n        // prop types still describe the span. The cast is that swap, written down.\n        {...(props as Checkbox.Root.Props)}\n      >\n        {config.webgl && <canvas aria-hidden=\"true\" className=\"lq-surface__shader\" ref={canvasRef} />}\n        {/* The mark is faded and scaled by CSS rather than mounted and\n            unmounted, so it has something to animate away from. */}\n        <Checkbox.Indicator className=\"lq-checkbox__mark\" keepMounted>\n          {indeterminate ? <MinusGlyph size={13} /> : <CheckGlyph size={13} />}\n        </Checkbox.Indicator>\n      </Checkbox.Root>\n      {(label || hint) && (\n        <span className=\"lq-checkbox__copy\">\n          {label && <span className=\"lq-control-label\">{label}</span>}\n          {hint && <span className=\"lq-control-hint\">{hint}</span>}\n        </span>\n      )}\n    </label>\n  )\n})\n\nLiquidCheckbox.displayName = 'LiquidCheckbox'\n",
      "path": "registry/liquid-checkbox.tsx",
      "type": "registry:ui"
    }
  ],
  "name": "liquid-checkbox",
  "registryDependencies": [
    "https://liquefy-ui.com/r/liquefy-ui.json",
    "https://liquefy-ui.com/r/internal-glyphs.json",
    "https://liquefy-ui.com/r/provider.json",
    "https://liquefy-ui.com/r/styles-prop.json",
    "https://liquefy-ui.com/r/use-liquid-glass.json"
  ],
  "title": "LiquidCheckbox",
  "type": "registry:ui"
}
