{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "slider",
  "title": "Slider",
  "author": "Tori Bryan",
  "description": "Picks a number, or a range, by dragging along a track.",
  "dependencies": [
    "@base-ui/react"
  ],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "registry/ui/slider.tsx",
      "content": "\"use client\"\n\nimport { Slider as SliderPrimitive } from \"@base-ui/react/slider\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype SliderProps = SliderPrimitive.Root.Props & {\n  /**\n   * Names each thumb for assistive technology, in order. A range needs one\n   * per thumb, such as \"Minimum price\" and \"Maximum price\".\n   */\n  thumbLabels?: string[]\n}\n\n/*\n * The thumb, not the root, is what receives focus and is announced, so an\n * `aria-label` on the slider is passed down to its thumbs.\n */\n/*\n * Children sit above the track, so a SliderLabel and a SliderValue placed\n * inside line up on one row over it, as they do in Progress.\n */\nfunction Slider({\n  className,\n  children,\n  defaultValue,\n  value,\n  min = 0,\n  max = 100,\n  thumbLabels,\n  \"aria-label\": ariaLabel,\n  ...props\n}: SliderProps) {\n  const values = Array.isArray(value)\n    ? value\n    : Array.isArray(defaultValue)\n      ? defaultValue\n      : [value ?? defaultValue ?? min]\n\n  return (\n    <SliderPrimitive.Root\n      data-slot=\"slider\"\n      className={cn(\n        \"data-horizontal:flex data-horizontal:w-full data-horizontal:flex-wrap data-horizontal:items-center data-horizontal:gap-3 data-vertical:h-full\",\n        className\n      )}\n      defaultValue={defaultValue}\n      value={value}\n      min={min}\n      max={max}\n      thumbAlignment=\"edge\"\n      {...props}\n    >\n      {children}\n      <SliderPrimitive.Control\n        data-slot=\"slider-control\"\n        className=\"relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col\"\n      >\n        <SliderPrimitive.Track\n          data-slot=\"slider-track\"\n          className=\"relative grow overflow-hidden rounded-full bg-input select-none data-horizontal:h-1.5 data-horizontal:w-full data-vertical:h-full data-vertical:w-1.5\"\n        >\n          <SliderPrimitive.Indicator\n            data-slot=\"slider-range\"\n            className=\"bg-primary select-none data-horizontal:h-full data-vertical:w-full\"\n          />\n        </SliderPrimitive.Track>\n        {values.map((_, index) => (\n          <SliderPrimitive.Thumb\n            data-slot=\"slider-thumb\"\n            key={index}\n            index={index}\n            aria-label={thumbLabels?.[index] ?? ariaLabel}\n            className=\"block size-4 shrink-0 rounded-full border border-primary bg-background shadow-sm ring-ring-subtle transition-shadow select-none hover:ring-[3px] has-[:focus-visible]:ring-[3px] data-disabled:pointer-events-none\"\n          />\n        ))}\n      </SliderPrimitive.Control>\n    </SliderPrimitive.Root>\n  )\n}\n\nfunction SliderLabel({ className, ...props }: SliderPrimitive.Label.Props) {\n  return (\n    <SliderPrimitive.Label\n      data-slot=\"slider-label\"\n      className={cn(\"text-sm font-medium\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction SliderValue({ className, ...props }: SliderPrimitive.Value.Props) {\n  return (\n    <SliderPrimitive.Value\n      data-slot=\"slider-value\"\n      className={cn(\n        \"ml-auto font-mono text-sm text-muted-foreground tabular-nums\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nexport { Slider, SliderLabel, SliderValue }\nexport type { SliderProps }\n",
      "type": "registry:ui"
    }
  ],
  "cssVars": {
    "theme": {
      "color-ring-subtle": "var(--ring-subtle)"
    },
    "light": {
      "ring-subtle": "color-mix(in oklch, var(--color-neutral-400) 50%, transparent)"
    },
    "dark": {
      "ring-subtle": "color-mix(in oklch, var(--color-neutral-500) 50%, transparent)"
    }
  },
  "meta": {
    "tier": "base-components",
    "group": "Forms",
    "docs": "https://fibo.toribryan.com/?path=/docs/base-components-forms-slider--docs"
  },
  "docs": "Docs and live examples: https://fibo.toribryan.com/?path=/docs/base-components-forms-slider--docs",
  "categories": [
    "base-components",
    "forms"
  ],
  "type": "registry:ui"
}