Socket
Socket
Sign inDemoInstall

react-two-thumb-input-range

Package Overview
Dependencies
6
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-two-thumb-input-range

Accessible two thumb input range component for React that implements


Version published
Weekly downloads
1.3K
increased by24.43%
Maintainers
1
Install size
352 kB
Created
Weekly downloads
 

Readme

Source

react-two-thumb-input-range

TwoThumbInputRange is a React component allowing users to input numeric values within a specific range.

Native HTML input type=range sliders do not support multiple thumbs yet so this component uses two range inputs and position them to look like a multi-thumb slider.

Under the hood TwoThumbInputRange uses HTML input type=range, but uses CSS Magic to allows users to adjust with 2 buttons

Features

  • Multi-Touch support
  • Accessible with ARIA and keyboard support
  • Highly Customizable
  • Written in TypeScript

Examples

All examples available in Storybook

Live Web App

Installation

yarn add react-two-thumb-input-range

# or

npm i react-two-thumb-input-range

Import components

import { TwoThumbInputRange } from "react-two-thumb-input-range"

Usage

function App() {
  const [value, setValue] = useState([1000, 4333])

  const onValueSChange = (values) => {
    setValue(values)
  }

  return <TwoThumbInputRange onChange={onValueChange} values={value} min={1000} max={10000} />
}

Props

AttributeTypeDefaultDescription
minnumber0The minimum permitted value.
maxnumber100The maximum permitted value.
values[number,number]The current value of the Input Range.
onChangefuncCallback function that is fired when the Input's value changed. onChange: ([number, number]) => void
railColorstring#EDF2F7Color of rail element.
trackColorstring#1976d2Color of track element.
thumbColorstring#EDF2F7Color of thumb element.
thumbStyleReact.CSSProperties1976d2Styles applied to the thumb element
thumbFocusStyleReact.CSSProperties``Styles applied to the when thumb element focus
inputStyleReact.CSSProperties``Styles applied to the input element
labelStyleReact.CSSProperties``Styles applied to the label element
labelTextStyleReact.CSSProperties``Styles applied to the label textelement
showLabelsbooleantrueIf false, the default labels will not render.
ariaValueTextstringMDN Web Docs

Keywords

FAQs

Last updated on 24 Mar 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc