0.3.0 • Published 5 months ago

react-circular-slider-svg v0.3.0

Weekly downloads
61
License
MIT
Repository
github
Last release
5 months ago

React Circular Slider

A full-featured circular slider React component, with full TypeScript definitions. See the docs and examples

Features:

  • Simple to use
  • No dependencies
  • Customizable:
    • Start/stop angle
    • Min/max value
    • 0, 1, or 2 handles
  • SVG based

Example

Install from npm: npm i react-circular-slider-svg

import CircularSlider from "react-circular-slider-svg";

export default () => {
  const [value1, setValue1] = useState(20);
  const [value2, setValue2] = useState(60);
  return (
    <CircularSlider
      size={200}
      trackWidth={4}
      minValue={0}
      maxValue={100}
      startAngle={40}
      endAngle={320}
      angleType={{
        direction: "cw",
        axis: "-y"
      }}
      handle1={{
        value: value1,
        onChange: v => setValue1(v)
      }}
      handle2={{
        value: value2,
        onChange: v => setValue2(v)
      }}
      arcColor="#690"
      arcBackgroundColor="#aaa"
    />
  );
};
0.3.0

5 months ago

0.2.0

2 years ago

0.1.4

4 years ago

0.1.5

4 years ago

0.1.3

4 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago