{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "slider",
  "title": "Slider",
  "description": "Range slider with one or more thumbs, built on Base UI Slider.",
  "dependencies": [
    "@base-ui/react@^1.8.0"
  ],
  "files": [
    {
      "path": "registry/rapid/ui/slider/slider.tsx",
      "content": "'use client'\n\nimport { Slider as SliderPrimitive } from '@base-ui/react/slider'\nimport { cn } from '@/lib/utils'\n\n/** One thumb per value: an array gives one thumb per entry, a single number one thumb, and no value a range */\nfunction getThumbCount(value: number | readonly number[] | undefined) {\n\tif (Array.isArray(value)) return value.length\n\treturn typeof value === 'number' ? 1 : 2\n}\n\nfunction Slider<Value extends number | readonly number[]>({\n\tclassName,\n\tdefaultValue,\n\tvalue,\n\tmin = 0,\n\tmax = 100,\n\t'aria-label': ariaLabel,\n\tgetAriaLabel,\n\tgetAriaValueText,\n\t...props\n}: SliderPrimitive.Root.Props<Value> &\n\tPick<SliderPrimitive.Thumb.Props, 'getAriaLabel' | 'getAriaValueText'> & {\n\t\t/** Accessible name for the thumb(s). For a labelled field, pass `aria-labelledby` with the label's id instead. */\n\t\t'aria-label'?: string\n\t}) {\n\tconst thumbCount = getThumbCount(value ?? defaultValue)\n\n\treturn (\n\t\t<SliderPrimitive.Root\n\t\t\tclassName={cn('data-horizontal:w-full data-vertical:h-full', className)}\n\t\t\tdata-slot=\"slider\"\n\t\t\tdefaultValue={defaultValue}\n\t\t\tvalue={value}\n\t\t\tmin={min}\n\t\t\tmax={max}\n\t\t\tthumbAlignment=\"edge\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<SliderPrimitive.Control className=\"relative flex w-full touch-none items-center select-none data-disabled:cursor-not-allowed data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col\">\n\t\t\t\t<SliderPrimitive.Track\n\t\t\t\t\tdata-slot=\"slider-track\"\n\t\t\t\t\tclassName=\"relative grow overflow-hidden rounded-full bg-secondary select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1\"\n\t\t\t\t>\n\t\t\t\t\t<SliderPrimitive.Indicator\n\t\t\t\t\t\tdata-slot=\"slider-range\"\n\t\t\t\t\t\tclassName=\"bg-primary select-none data-horizontal:h-full data-vertical:w-full\"\n\t\t\t\t\t/>\n\t\t\t\t</SliderPrimitive.Track>\n\t\t\t\t{Array.from({ length: thumbCount }, (_, index) => (\n\t\t\t\t\t<SliderPrimitive.Thumb\n\t\t\t\t\t\tdata-slot=\"slider-thumb\"\n\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: thumbs are identified by their position\n\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t// The thumbs carry role=\"slider\", so the accessible name and value text go on them, not on the root\n\t\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\t\tgetAriaLabel={getAriaLabel}\n\t\t\t\t\t\tgetAriaValueText={getAriaValueText}\n\t\t\t\t\t\tclassName=\"relative block size-3 shrink-0 rounded-full border border-primary bg-background ring-ring/50 transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:ring-ring focus-visible:outline-hidden active:ring-3 has-focus-visible:ring-3 has-focus-visible:ring-ring data-disabled:pointer-events-none data-disabled:opacity-50\"\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</SliderPrimitive.Control>\n\t\t</SliderPrimitive.Root>\n\t)\n}\n\nexport { Slider }\n",
      "type": "registry:ui",
      "target": "components/ui/slider.tsx"
    }
  ],
  "type": "registry:ui"
}