jshguo

Slider

Component 1

About

Slider component built on Radix UI — supports single value and range selection.

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

Code

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

Usage.tsx

"use client"

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

export default function SliderRangeDemo() {
  const [values, setValues] = useState([20, 80])

  return (
    <div className="flex w-full min-h-screen items-center justify-center bg-background p-8 overflow-hidden">
      <div className="w-full max-w-sm space-y-5">
        <div className="space-y-2">
          <div className="flex items-center justify-between text-sm">
            <span className="font-medium">Price Range</span>
            <span className="text-muted-foreground">${values[0]} – ${values[1]}</span>
          </div>
          <Slider
            value={values}
            onValueChange={setValues}
            min={0}
            max={200}
            step={5}
          />
        </div>
      </div>
    </div>
  )
}

Dependencies

More by jshguo

View all
  • Progress

    Progress

    426
  • Select

    Select

    369
  • Textarea

    Textarea

    258
  • Input OTP

    Input OTP

    160
  • Interfaces Carousel

    Interfaces Carousel

    160
  • Switch

    Switch

    136
  • Hover Card

    Hover Card

    109
  • Card

    Card

    85