Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-custom-slider

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-custom-slider

a very easy to use customizable slider for React

  • 1.0.5
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-custom-slider

a very easy to use customizable slider for React

  • easy to use
  • no dependencies
  • flexible (few required parameters but highly customizable)

NPM JavaScript Style Guide

Install

npm install --save react-custom-slider

Usage

import React from 'react'

import Slider from 'react-custom-slider';

const App = () => {
  const [ value, setValue ] = React.useState(0);

  return(
      <div style={styles.container}>
        <Slider
          value={value}
          defaultValue={value}
          onChange={(value) => setValue(value)}
        />
      </div>
  )
};

const styles = {
  container: {
    backgroundColor: 'transparent',
    margin: 100
  }
}

export default App

Props

PropTypeDescription
valuenumber (required)controlled value
defaultValuenumber (required)uncontrolled value
showValuetrue, false, 'active'displays current value on a label
valueLabelColorstring
valueLabelActiveColorstring
valueLabelStyleobjectuser custom style for value label
minnumbermin slider value
maxnumbermax slider value
stepSizenumberinterval between 2 steps
disabledboolean
disabledColorstringcolor used when the slider is disabled
onChangefunction (callback)called every time value changes ( value as argument)
onReleasefunction (callback)called once slider is released ( value as argument)
valueRendererfunction (callback)used by value label (to display a unit such as %)
trackLengthnumber
trackColorstring
trackThicknessnumber
trackShape'squared', 'rounded'
trackStyleobjectuser custom styling for track
handlerSizenumbersets handler diameter (both width and height)
handlerWidthnumber
handlerHeightnumber
handlerShape'squared', 'rounded'
handlerColorstring
handlerBorderColor
handlerActiveColorstringhandler color when slider is being used
handlerStyleobjectuser custom styling for handler
fontSizenumberused by markers
fontColorstringused by markers
markersnumbernumbers of markers to display
markersSizenumbermarkers container's height or width (depending on the orientation)
showMarkerstrue, false, 'hidden', 'active', 'inactive''active' displays the markers only when slider is beeing used, 'inactive' the opposite
grabCursorbooleanwhen true shows a grabbing cursor as slider is beeing used
verticalbooleanslider's layout horizontal or vertical
invertMarkersbooleanswitch slider and markers positions
styleobjectuser custom style for slider's root container

License

MIT © jonisapp

Keywords

FAQs

Package last updated on 29 Sep 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc