Code Monkey home page Code Monkey logo

circular-slider's Introduction

circular-slider

React component to drag a point along a circular path

Installation

npm install circular-slider --save

Example

import React from 'react';
import { CircularSlider } from 'circular-slider';

class MyFancyGauge extends React.Component {
  state = {
    angle: 0
  }
  render() {
    return (
      <CircularSlider
        angle={this.state.angle}
        onMove={angle => this.setState({ angle })}
      />
    );
  }
}

Options

Prop Type Default Description
angle Number 200 Current angle of handle
arcEnd Number 360 Angle of end of optional arc
arcStart Number 180 Angle of start of optional arc
color String darkseagreen Color of handle (and optional needle & arc)
onMove Function () => {} Handler function (takes new angle as sole argument)
r Number 100 Radius of the path the slider follows
showArc Boolean false Renders a circular arc
showNeedle Boolean true Renders a line from center to handle

Note: Angles are measured in degrees, clockwise from the positive x-axis.

circular-slider's People

Contributors

dan-kwiat avatar bluenex avatar

Watchers

James Cloos avatar zgatrying avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.