Function
Slider
({ value, min, max, step = 1, onChange, showValue = true, unit = "", className }: SliderProps)
Source from the content-addressed store, hash-verified
| 94 | } |
| 95 | |
| 96 | export function Slider({ value, min, max, step = 1, onChange, showValue = true, unit = "", className }: SliderProps) { |
| 97 | return ( |
| 98 | <div className={cn("flex items-center gap-3", className)}> |
| 99 | <input |
| 100 | type="range" |
| 101 | min={min} |
| 102 | max={max} |
| 103 | step={step} |
| 104 | value={value} |
| 105 | onChange={(e) => onChange(Number(e.target.value))} |
| 106 | className="flex-1 h-1.5 bg-surface-700 rounded-full appearance-none cursor-pointer accent-brand-500" |
| 107 | /> |
| 108 | {showValue && ( |
| 109 | <span className="text-xs text-surface-300 w-12 text-right font-mono"> |
| 110 | {value}{unit} |
| 111 | </span> |
| 112 | )} |
| 113 | </div> |
| 114 | ); |
| 115 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected