react-simple-knob
A simple knob element for react.
Installing
$ npm i --save react-simple-knob
or
$ yarn add react-simple-knob
Usage
Import the component
;
and then use it:
{ const style = margin: "20%" height: "100px" fontFamily: "Arial" color: "white" // Sets font color of value and knob name ; return <Knob name="Volume" unit="dB" defaultPercentage=07 onChange=consolelog bg="black" fg="white" mouseSpeed=5 transform= - 50 style=style /> ;}
Contributing
To try the component:
$ git clone git@github.com:TimDaub/react-simple-knob.git$ npm i$ npm run dev
Current Limitations
Any help is very much appreciated. I'll try to merge your PRs as soon as I can! The following things could be improved:
- Component doesn't scale automatically based on
name
andunit
props - Only very limited styling possible
Changelog
0.0.6
- Bugfix: Fix Arc background
0.0.5
- Make
fontSize
configurable usingstyle
props
0.0.4
- Bugfix: Make style options (
color
andfontFamily
) optional
0.0.3
- Allow very limited styling
0.0.2
- Bugfix: Fix
defaultPercentage
prop
0.0.1
- Initial release
License
MIT