Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Simple react round slider. Supports touch events.

License

NotificationsYou must be signed in to change notification settings

themre/roundy

Repository files navigation

Roundy

Configurable react round slider. Supports touch events.

Installation

npm i roundy (or yarn add roundy)

Usage

Roundy

You can use Roundy as a single slider:
importRoundyfrom'roundy';const{value}=this.state<Roundyvalue={value}min={10}max={30}stepSize={5}radius={100}color='pink'onChange={value=>this.setState({value})}onAfterChange={(value,props)=> ...}overrideStyle={ ...stringtemplateasCSS...}/>

You can create pie round chart

<RoundyarcSize={270}min={10}max={30}rotationOffset={-45}/>

Or use roundy as a group of sliders:

import{RoundyGroup}from'roundy'<RoundyGroupsliders={[{value:30,step:10,id:'mjaw',max:50,radius:60,color:'blueviolet',onChange:(val,props)=>console.log(props)},{value:30,step:10,max:50,radius:100},{value:100,step:20,max:200,color:'orange',radius:140,sliced:false,step:1}]}/>

API

Roundy provides the following API:

PropDescriptionDefault
valuenumber: Slider value50
minnumber: Minimal value0
maxnumber: Maximum value100
stepSizenumber: Step value to snap value0
stepsnumber: Number of steps that will be snapable0
radiusnumber: Slider radius100
colorstring: Active slider color'purple'
bgColorstring: Slider arc color'#ccc'
strokeWidthnumber: Slider arc width15
thumbSizenumber: Size (diameter) of thumb20
slicedboolean: Provide slices based on step valuetrue
onChangefunction: immediate callback function (value, props)null
onAfterChangefunction: callback function after release (value, props)null
overrideStylestring: provide additional class style which will be injected into styled-components classnull
arcSizenumber: Size of the arc. Default is 360, can be between 1 and 360360
rotationOffsetnumber: rotation of the whole circle. Can be between -180 and 1800
renderrender prop function that has a signature: ({value, angle}, props) => Nodenull

Testing

TODO

Contribution

Always happy to take PRs.

About

Simple react round slider. Supports touch events.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp