MCPcopy Create free account
hub / github.com/composify-js/composify / Slider

Function Slider

packages/docs/src/ui-system/Slider/Slider.tsx:13–33  ·  view source on GitHub ↗
({ className, min, max, step = 1, value, onChange })

Source from the content-addressed store, hash-verified

11};
12
13export const Slider: FC<Props> = ({ className, min, max, step = 1, value, onChange }) => {
14 const progress = ((value - min) / (max - min)) * 100;
15
16 return (
17 <input
18 type="range"
19 className={variants({ className })}
20 min={min}
21 max={max}
22 step={step}
23 value={value}
24 onChange={(e) => onChange(Number(e.target.value))}
25 style={
26 {
27 background: `linear-gradient(to right, var(--primary) ${progress}%, var(--muted) ${progress}%)`,
28 '--progress': `${progress}%`,
29 } as React.CSSProperties
30 }
31 />
32 );
33};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected