shadcn

Slider

Forms 10

About

An input where the user selects a value from within a given range.

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

import { cn } from "@/lib/utils"
import { Slider } from "@/components/ui/slider"

type SliderProps = React.ComponentProps<typeof Slider>

export function SliderDemo({ className, ...props }: SliderProps) {
  return (
    <Slider
      defaultValue={[50]}
      max={100}
      step={1}
      className={cn("w-[60%]", className)}
      {...props}
    />
  )
}

Dependencies

More by shadcn

View all
  • Navigation menu

    Navigation menu

    792
  • Calendar with time pressets

    Calendar with time pressets

    518
  • Sidebar

    Sidebar

    354
  • Sonner

    Sonner

    239
  • Chart

    Chart

    222
  • Icons

    Icons

    200
  • Dropdown Menu

    Dropdown Menu

    157
  • Calendar with event slots

    Calendar with event slots

    124

More in Forms

View all
  • Premium Auth

    Premium Auth

    543
  • Contact Card

    Contact Card

    1.1K
  • Form

    Form

    17
  • Card Studio

    Card Studio

    46
  • Book A Demo 1

    Book A Demo 1

    80
  • Login 2

    Login 2

    10
  • Login 1

    Login 1

    58
  • Input

    Input

    14