1.1.0 • Published 4 years ago

react-slider-measure v1.1.0

Weekly downloads
36
License
MIT
Repository
github
Last release
4 years ago

react-slider-measure

Description

react-slider-measure is a customizable, pure JavaScript package, that provides a smooth user interface for picking a value within a measure styled bar.

Demo

Demo

Also: see gatsby/pages folder. You can run it locally using Gatsby just clone the repos and use yarn start in your CLI.

Installation

yarnnpm
yarn add react-slider-measurenpm add react-slider-measure

Usage

import React, { useState } from "react";
import { Slider } from "react-slider-measure";

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

	return (
		<div>
			<Slider
				activeColor="#5a2cc9"
				steps={100}
				value={value}
				onChange={setValue}
			/>
		</div>
	)
}

API

PropsTypeRequiredDefaultDescription
stepsstringtrue40Defines the total numbers on the slider
valuenumbertrue-Slider current value
onChangefunctiontrue-Retrieve the selected value from the slider
activeColorstringfalse#5a2cc9Active color for the selected value

Crédits

Build at Igloo with @loicmahieu.