Coder Social home page Coder Social logo

bolonio / react-component-range Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 4.17 MB

React Component Range is a simple and minimal React input range component

Home Page: https://www.npmjs.com/package/react-component-range

JavaScript 80.87% Less 19.13%
react reactjs react-component react-components input input-range range range-slider range-component javascript

react-component-range's Introduction

react-component-range

npm version Build Status

React Component Range is a simple and minimal React input range component

Install

npm install react-component-range

Usage

import React, { Component } from "react";
import ReactRange from "react-component-range";

class App extends Component {
  onChange = value => {
    console.debug("Value: ", value);
  };

  render() {
    return (
      <ReactRange
        min={0}
        max={100}
        defaultValue={50}
        ariaLabel="Slider to adjust the volume"
        onChange={this.onChange}
      />
    );
  }
}

export default App;

Props

Name Type Default Description
id string The id of the input (range)
name string The input's name, to identify the input in the data submitted with the form's data
min number 0 The minimum permitted value
max number 100 The maximum permitted value
step number 1 The stepping interval, used both for user interface and validation purposes
onChange function () => {} The callback action to be performed when the value changes. It returns the current value.
value number The input's current value
defaultValue number 0 The input's initial value
ariaLabel string The accesibility aria-label property of the input
ariaLabelledby string The accesibility aria-labelledby property of the input
disabled boolean false A Boolean attribute which is present if the input should be disabled
required bollean false A Boolean which, if true, indicates that the input must have a value before the form can be submitted
tabIndex number A numeric value providing guidance to the user agent as to the order in which controls receive focus when the user presses the Tab key

Contributing

Feel free to submit issues and enhancement requests.

Please refer to each project's style guidelines and guidelines for submitting patches and additions. In general, we follow the "fork-and-pull" Git workflow.

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

Future actions

  • Typescript component
  • Write tests for the component
  • Personalization (color and size)

react-component-range's People

Stargazers

 avatar

Watchers

 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.