Forms
Slider
Range slider with fill track, value display, min/max labels, and custom thumb styling
Quick Preview
Volume60
0100
Installation
// Copy the Slider component fromsrc/components/forms/Slider.tsx
Usage
'use client'import { useState } from 'react'import { Slider } from '@/components/forms/Slider'export default function Example() {const [volume, setVolume] = useState(60)return (<Slidervalue={volume}onChange={setVolume}label="Volume"showValue/>)}
Examples
Custom Step
Step: 1050
0100
Custom Min / Max
Temperature (ยฐC)22
1630
Multiple Sliders
Brightness80
0100
Contrast50
0100
Saturation60
0100
Disabled
Locked40
0100
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value* | number | - | Current slider value |
onChange* | (value: number) => void | - | Value change handler |
min | number | 0 | Minimum value |
max | number | 100 | Maximum value |
step | number | 1 | Step increment |
label | string | - | Label text above the slider |
showValue | boolean | - | Show current value beside label |
disabled | boolean | - | Disable the slider |
Features
- โCustom fill track (primary color)
- โCustom styled thumb
- โLabel and live value display
- โMin / Max labels below track
- โKeyboard accessible (arrow keys)
- โClient Component