alexander-rukin

Range Slider

Forms

About

A draggable track-and-knob slider for picking a single value or a min/max range, with full keyboard and touch support.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Range Slider to your project and fits it to your theme.

Code

How Range Slider is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import Slider from "@/components/ui/slider";
import { useState } from "react";

export default function RangeSliderDemo() {
  const [price, setPrice] = useState<[number, number]>([200, 700]);

  return (
    <div className="w-full max-w-sm mx-auto p-6">
      <Slider
        range
        value={price}
        onChange={setPrice}
        min={0}
        max={1000}
        step={50}
        showValue
        ariaLabel="Price"
        formatValue={(v) => `${v} \u20ac`}
      />
      <div className="mt-3 text-sm text-muted-foreground">
        From <b className="text-foreground">{price[0]} \u20ac</b> to{" "}
        <b className="text-foreground">{price[1]} \u20ac</b>
      </div>
    </div>
  );
}

More by alexander-rukin

View all
  • Carousel

    Carousel

    15
  • Combobox

    Combobox

  • Textarea

    Textarea

  • Tooltip

    Tooltip

  • Card

    Card

  • Input

    Input

  • Date Picker

    Date Picker

More in Forms

View all
  • Login 1

    Login 1

    64
  • Premium Auth

    Premium Auth

    571
  • Contact Card

    Contact Card

    1.1K
  • Form

    Form

    18
  • Book A Demo 1

    Book A Demo 1

    91
  • Authentication Card

    Authentication Card

    52
  • Card Studio

    Card Studio

    47
  • Login Card

    Login Card

    35