New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

rc-ruler

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-ruler

ruler component for react

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
15
50%
Maintainers
1
Weekly downloads
 
Created
Source

rc-ruler

Ruler component for React

Why

设计稿

为了实现上面的设计,折腾了一个这样的轮子。

效果如下

效果

  • 仅支持PC端
  • 支持拖拽、点击来选择相应的值
  • 可以和Ant-Design的Form结合
  • 依赖rxjs处理事件(按需加载)

Install

npm install rc-ruler --save

Usage

import Ruler from 'rc-ruler';
import 'rc-ruler/dist/index.css';
handleDragChange = (value) => {
   console.log(value);
}

<Ruler
   value={value}
   onDrag={this.handleDragChange}
   start={20}
   end={99}
   step={2}
/>

Proptypes

   propTypes: {

      // current value
      value: PropTypes.number,

      // start value
      start: PropTypes.number,

      // end value
      end: PropTypes.number,

      // step of drag
      step: PropTypes.number,

      // handle drag function
      onDrag: PropTypes.func,

      // class of component
      className: PropTypes.string,
   }

License

MIT

Keywords

react

FAQs

Package last updated on 02 Jan 2019

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