my/ui

Command Palette

Search for a command to run...

All components

Slider Label Tooltip

sliders

Origin UI component.

responsive · 600px

Install

Same command in any shadcn project — React (Vite/CRA), Next.js, Remix, Astro, and more:

$npx shadcn@latest add https://your-domain/r/comp-249.json

Usage

import Cmp from "@/registry/origin-ui/comp-249";

export default function Demo() {
  return <Cmp />;
}

Component source

import { Label } from "@/components/ui/label";
import { Slider } from "@/components/ui/slider";

export default function Component() {
  return (
    <div className="*:not-first:mt-4">
      <Label>Slider with labels and tooltip</Label>
      <div>
        <span
          aria-hidden="true"
          className="mb-3 flex w-full items-center justify-between gap-2 font-medium text-muted-foreground text-xs"
        >
          <span>Low</span>
          <span>High</span>
        </span>
        <Slider
          aria-label="Slider with labels and tooltip"
          defaultValue={[50]}
          showTooltip={true}
          step={10}
        />
      </div>
    </div>
  );
}

Source: Origin UI