npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-ion-slider

v1.0.17

Published

ion-slider react version

Downloads

670

Readme

NPM JavaScript Style Guide

Table of Contents

About The Project

Ion-rangeslider react module, this module mapping ion-rangeslider properties to props.

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • npm
npm install npm@latest -g
  • react
npm install --save react react-dom

Installation

  1. Npm install

    npm install --save react-ion-slider
    yarn add react-ion-slider --save

Usage

Get Started

Normal

  1. Before using react-ion-slider please import module
import IonRangeSlider from 'react-ion-slider'
  1. Implement below codes in the react render method
  <IonRangeSlider type={} min={} max={} from={} to={} step={} values={} keyboard={} />
  1. Update options manually without componentDidMount
<IonRangeSlider ref={r => this.ionSlider = r} />

this.ionSlider.update({skin: 'flat', min: 100, max: 500, from: 120, to: 240, type: 'double'})

Next.js

  1. Before using react-ion-slider please import jquery module in your HEAD
<Head>
        <title>Create Next App</title>
        <link rel="icon" href="/favicon.ico" />
        <script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossOrigin="anonymous"></script>
</Head>
  1. Please load using dynamic import
const IonRangeSlider = dynamic(() => import('react-ion-slider'),{ssr: false})

Supported Props

| Option | Defaults | Type | Description | |------------------------|----------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Basic setup | | | | | type | "single" | string | Choose slider type, could be single - for one handle, or double for two handles | | min | 10 | number | Set slider minimum value | | max | 100 | number | Set slider maximum value | | from | min | number | Set start position for left handle (or for single handle) | | to | max | number | Set start position for right handle | | Advanced setup | | | | | step | 1 | number | Set sliders step. Always > 0. Could be fractional. | | values | [] | array | Set up your own array of possible slider values. They could be numbers or strings. If the values array is set up, min, max and step param, are no longer can be changed. | | keyboard | TRUE | boolean | Activates keyboard controls. Move left: ←, ↓, A, S. Move right: →, ↑, W, D. | | Grid setup | | | | | grid | FALSE | boolean | Enables grid of values. | | grid_margin | TRUE | boolean | Set left and right grid borders. | | grid_num | 4 | number | Number of grid units. | | grid_snap | FALSE | boolean | Snap grid to sliders step (step param). If activated, grid_num will not be used. | | Interval control | | | | | drag_interval | FALSE | boolean | Allow user to drag whole range. Only in double type | | min_interval | — | number | Set minimum diapason between sliders. Only in double type | | max_interval | — | number | Set maximum diapason between sliders. Only in double type | | Handles control | | | | | from_fixed | FALSE | boolean | Fix position of left (or single) handle. | | from_min | min | number | Set minimum limit for left handle. | | from_max | max | number | Set the maximum limit for left handle | | from_shadow | FALSE | boolean | Highlight the limits for left handle | | to_fixed | FALSE | boolean | Fix position of right handle. | | to_min | min | number | Set the minimum limit for right handle | | to_max | max | number | Set the maximum limit for right handle | | to_shadow | FALSE | boolean | Highlight the limits for right handle | | UI control | | | | | skin | "flat" | string | Choose UI skin to use | | hide_min_max | FALSE | boolean | Hides min and max labels | | hide_from_to | FALSE | boolean | Hide from and to labels | | force_edges | FALSE | boolean | Slider will be always inside it's container. | | extra_classes | — | string | Traverse extra CSS-classes to slider container | | block | FALSE | boolean | Locks slider and makes it inactive (visually). input is NOT disabled. Can still be send with forms. | | Prettify numbers | | | | | prettify_enabled | TRUE | boolean | Improve readability of long numbers. 10000000 → 10 000 000 | | prettify_separator | " " | string | Set up your own separator for long numbers. 10 000, 10.000, 10-000 etc. | | prettify | null | function | Set up your own prettify function. Can be anything. For example, you can set up unix time as slider values and than transform them to cool looking dates. | | — | | | | | prefix | — | string | Set prefix for values. Will be set up right before the number: $100 | | postfix | — | string | Set postfix for values. Will be set up right after the number: 100k | | max_postfix | — | string | Special postfix, used only for maximum value. Will be showed after handle will reach maximum right position. For example 0 — 100+ | | decorate_both | TRUE | boolean | Used for "double" type and only if prefix or postfix was set up. Determine how to decorate close values. For example: $10k — $100k or $10 — 100k | | values_separator | " — " | string | Set your own separator for close values. Used for double type. Default: 10 — 100. Or you may set: 10 to 100, 10 + 100, 10 → 100 etc. | | Data control | | | | | input_values_separator | " ; " | string | Separator for double values in input value property. Default FROM;TO. Only for double type | | disable | FALSE | boolean | Locks slider and makes it inactive. inputis disabled too. Invisible to forms. | | Callbacks | | | | | scope | null | object | Scope for callbacks. Pass any object. Callback will be executed like this: onChange.call(scope); | | onStart | null | function | Callback. Is called on slider start. | | onChange | null | function | Callback. IS called on each values change. | | onFinish | null | function | Callback. Is called than user releases handle. | | onUpdate | null | function | Callback. Is called than slider is modified by external methods update or reset. |

Ref Functions

| Option | Defaults | Type | Description | |--------|----------|----------|---------------------------------| | update | null | function | You can update options manually |

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

GiPyeong Lee - @gipyeong - [email protected]

Project Link: https://github.com/gipyeong-lee/react-ion-slider

Reference

Best Readme Template