{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "slider",
  "title": "Slider",
  "description": "Displays a slider built on the Base UI Slider primitive.",
  "dependencies": [
    "@base-ui/react@^1.7.0",
    "cn@^0.5.2"
  ],
  "registryDependencies": [
    "https://sevenui.dev/r/sevenui-tokens.json"
  ],
  "files": [
    {
      "path": "registry/base/ui/slider.tsx",
      "content": "import { Slider as SliderPrimitive } from \"@base-ui/react/slider\";\nimport { cn } from \"cn\";\n\nfunction Slider({\n  className,\n  defaultValue,\n  value,\n  min = 0,\n  max = 100,\n  ...props\n}: SliderPrimitive.Root.Props) {\n  // Base UI defaults an uncontrolled slider to the scalar `min`, so the\n  // no-value fallback is a single thumb (a [min, max] fallback would render\n  // two thumbs both bound to that scalar).\n  const _values = Array.isArray(value)\n    ? value\n    : Array.isArray(defaultValue)\n      ? defaultValue\n      : [min];\n\n  return (\n    <SliderPrimitive.Root\n      className={cn(\n        // The thumb size steps with density through --slider-thumb.\n        \"[--slider-thumb:0.875rem] [[data-density=compact]_&]:[--slider-thumb:0.75rem] data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full\",\n        className,\n      )}\n      data-slot=\"slider\"\n      defaultValue={defaultValue}\n      value={value}\n      min={min}\n      max={max}\n      thumbAlignment=\"edge\"\n      {...props}\n    >\n      <SliderPrimitive.Control className=\"relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-40 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col\">\n        <SliderPrimitive.Track\n          data-slot=\"slider-track\"\n          className=\"relative grow overflow-hidden rounded-full bg-muted select-none data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1\"\n        >\n          <SliderPrimitive.Indicator\n            data-slot=\"slider-range\"\n            className=\"bg-primary select-none data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full\"\n          />\n        </SliderPrimitive.Track>\n        {Array.from({ length: _values.length }, (_, index) => (\n          <SliderPrimitive.Thumb\n            data-slot=\"slider-thumb\"\n            key={index}\n            // Base UI focuses the nested <input type=\"range\">, so the focus\n            // ring also follows has-focus-visible on the thumb.\n            className=\"relative block size-(--slider-thumb) shrink-0 rounded-full border border-ring bg-white shadow-raised ring-ring/50 transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden has-focus-visible:ring-3 active:ring-3 data-disabled:pointer-events-none disabled:pointer-events-none disabled:opacity-50\"\n          />\n        ))}\n      </SliderPrimitive.Control>\n    </SliderPrimitive.Root>\n  );\n}\n\nexport { Slider };\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}