my/ui

Command Palette

Search for a command to run...

All components

Dual Range With Output

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-251.json

Usage

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

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

Component source

"use client";

import { useState } from "react";

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

export default function Component() {
  const [value, setValue] = useState([25, 75]);

  return (
    <div className="space-y-4">
      <div className="flex items-center justify-between gap-2">
        <Label className="leading-6">Dual range slider with output</Label>
        <output className="font-medium text-sm tabular-nums">
          {value[0]} - {value[1]}
        </output>
      </div>
      <Slider
        aria-label="Dual range slider with output"
        onValueChange={setValue}
        value={value}
      />
    </div>
  );
}

Source: Origin UI