🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-ticker-input

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-ticker-input

A minimal reactjs package to render a number input with ticker selectors. 🔥🔥

0.1.6
latest
Source
npm
Version published
Weekly downloads
2
-80%
Maintainers
1
Weekly downloads
 
Created
Source

React Ticker Input

A minimal reactjs package to render a number input with ticker selectors. 🔥🔥

react ticker input

Live Playground

To see the react number input in action, click here.

OR

To run that demo on your computer:

  • Clone this repository
  •   npm install
    
  •   npm start
    
  • Visit http://localhost:3000/

Getting Started

Import Component

    import Ticker from 'react-ticker-input'

Usage

This is the minimum code required to get started with react-ticker-input. Other required and non-required props are documented below.

    import React, { useState } from 'react'
    import Ticker from 'react-ticker-input'

    const App = () => {
    
        const [value, setValue] = useState(10)
        return <Ticker 
            value={value}
            setValue={setValue}
        />
    }

    export default App

Supported Props

namedescriptiondefaultrequiredtype
valuevalue of the controlled input (should be a component state)0truenumber
setValuefunction called when value changes with updated valueundefinedtruefunction ⎮ undefined
minminimum value of the input0falsenumber
maxmaximum value of the input100falsenumber
majorGapgap between taller (prominent) ticks10falsenumber
minorGapgap between smaller ticks2falsenumber
hideTextif true, hides the value textfalsefalseboolean
textFormatterfunction that takes in the value and can be used to format itundefinedfalsefunction ⎮ undefined
throttleScrollif true, applies throttling while scroll improves performance, decreases UXfalsefalseboolean
throttleTimeoutdelay for scroll throttle250falsenumber
stickMaxWidthmax width between two sticks in vw4falsenumber
knobClassNameclassName for the knob pointer''falsestring
containerClassNameclassName for the outermost container''falsestring
textClassNameclassName for the top text''falsestring
tickerClassNameclassName for the container that contains all the sticks''falsestring
tickClassNameclassName for all the sticks (tall and small both)''falsestring
largeTickClassNameclassName for the taller sticks''falsestring
tickLabelClassNameclassName for the label text displayed beneath taller sticks''falsestring

Other thing that should be taken care of is that majorGap, the difference between max and min, both should be a multiple of the minGap.

Keywords

reactjs

FAQs

Package last updated on 15 Oct 2022

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