{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "slider-14",
  "title": "Slider with three thumbs",
  "description": "Gradient stops with a percentage bubble on each thumb.",
  "dependencies": [],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/label.json",
    "https://ui.ndekocode.dev/r/slider.json",
    "https://ui.ndekocode.dev/r/theme.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/components/slider/slider-14.tsx",
      "content": "'use client';\n\nimport { useState } from 'react';\n\nimport { Label } from '@/registry/ndeko/ui/label';\nimport { Slider, SliderThumbValue } from '@/registry/ndeko/ui/slider';\n\ntype SliderValue = number | readonly number[];\n\nconst BUBBLE_LOOK = [\n  'mb-2.5 rounded-lg bg-transparent px-2 py-1 text-popover-foreground',\n  '[--bubble-top:var(--popover)] [--bubble-bottom:color-mix(in_oklab,var(--popover),var(--primary)_9%)]',\n  'bg-linear-to-b from-(--bubble-top) to-(--bubble-bottom) hairline-ring ring-border shadow-md shadow-black/6',\n].join(' ');\n\nconst STOP_LABELS = ['First stop', 'Middle stop', 'Last stop'];\n\nfunction valuesOf(value: SliderValue) {\n  if (typeof value === 'number') {\n    return [value];\n  }\n  return [...value];\n}\n\nexport default function Slider14() {\n  const [stops, setStops] = useState([25, 50, 100]);\n\n  function changeStops(value: SliderValue) {\n    const nextStops = valuesOf(value);\n    setStops(nextStops);\n  }\n\n  function renderStop(index: number) {\n    return (\n      <SliderThumbValue className={BUBBLE_LOOK}>\n        {stops[index]}%\n      </SliderThumbValue>\n    );\n  }\n\n  return (\n    <div className='flex w-full max-w-xs flex-col gap-3 px-3'>\n      <Label>Gradient stops</Label>\n      <Slider\n        value={stops}\n        onValueChange={changeStops}\n        thumbLabels={STOP_LABELS}\n        thumbContent={renderStop}\n      />\n    </div>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "categories": [
    "components",
    "slider"
  ],
  "type": "registry:component"
}