New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jhoward1994/react-circular-slider

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jhoward1994/react-circular-slider

A customizable circular slider with no dependencies.

  • 2.5.20
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
increased by1100%
Maintainers
1
Weekly downloads
 
Created
Source

react-circular-slider

A highly customizable circular slider with no dependencies. See some live demos here!

An image showing the CircularSlider settings

install

npm install @fseehawer/react-circular-slider

example

import React from 'react';
import CircularSlider from '@fseehawer/react-circular-slider';

const App = () => {
    return (
        <CircularSlider
            onChange={ value => { console.log(value); } }
        />
    )
};

export default App;

Use min and max props to define the range of numbers. Use prependToValue/appendToValue if you want to prepend/append e.g. "$" or "°" to the value. Or simply use the data prop and pass any number or string sequence as an array to be spread in 360°. See some live demos here!

import React from 'react';
import CircularSlider from '@fseehawer/react-circular-slider';

const App = () => {
    return (
        <CircularSlider
            label="savings"
            labelColor="#005a58"
            knobColor="#005a58"
            progressColorFrom="#00bfbd"
            progressColorTo="#009c9a"
            progressSize={24}
            trackColor="#eeeeee"
            trackSize={24}
            data={["1€","2€"]} //...
            dataIndex={10}
            onChange={ value => { console.log(value); } }
        />
    )
};

export default App;

Props

proptypedefaultAffects
widthnumber280width of the slider
directionnumber1clockwise (1) or anticlockwise (-1)
minnumber0smallest value
maxnumber360largest value
initialValuenumber0set an initial value for the label
dataarray[]array of data to be spread in 360°
dataIndexnumber0initially place knob at a certain value in the array
knobColorstring#4e63eaknob color
knobSizenumber32knob size
hideKnobbooleanfalsehide knob
knobDraggablebooleantrueknob draggable
knobPositionstringtopknob's 0 position to be top, right, bottom or left
labelstringANGLElabel
labelColorstring#272b77label and value color
labelBottombooleanfalselabel position at bottom
labelFontSizestring1remlabel font-size
valueFontSizestring4remlabel value font-size
appendToValuestring''append character to value
prependToValuestring''prepend character to value
renderLabelValuejsxnulladd custom jsx code for the labels and styles
verticalOffsetstring2remvertical offset of the label and value
hideLabelValuebooleanfalsehide label and value
progressColorFromstring#80C3F3progress track gradient start color
progressColorTostring#4990E2progress track gradient end color
progressSizenumber8progress track size
progressLineCapstringroundprogress track cap to be round or flat
trackColorstring#DDDEFBbackground track color
trackSizenumber8background track size
trackDraggablebooleanfalsemake the track draggable
onChangefuncvalue => {}returns label value
isDraggingfuncvalue => {}returns isDragging value
continuousobject...apply settings to enable continuous mode
continuous.enabledbooleanfalsewhether continuous mode is enabled
continuous.clicksnumber120the amount of clicks per loop cycle
continuous.intervalnumber1the amount to increment/decrement with each click

Please consider a small donation. Even one dollar will help to maintain and develop new features. Thanks!

You can find the donate button on the bottom of the example page

license

MIT License

Keywords

FAQs

Package last updated on 05 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc