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-ticker-input

v0.1.6

Published

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

Downloads

9

Readme

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:

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

| name | description | default | required | type | |--------------------|-----------------------------------------------------------------------------|-------------|--------------|----------------------| | value | value of the controlled input (should be a component state) | 0 | true | number | | setValue | function called when value changes with updated value | undefined | true | function ⎮ undefined | | min | minimum value of the input | 0 | false | number | | max | maximum value of the input | 100 | false | number | | majorGap | gap between taller (prominent) ticks | 10 | false | number | | minorGap | gap between smaller ticks | 2 | false | number | | hideText | if true, hides the value text | false | false | boolean | | textFormatter | function that takes in the value and can be used to format it | undefined | false | function ⎮ undefined | | throttleScroll | if true, applies throttling while scroll improves performance, decreases UX | false | false | boolean | | throttleTimeout | delay for scroll throttle | 250 | false | number | | stickMaxWidth | max width between two sticks in vw | 4 | false | number | | knobClassName | className for the knob pointer | '' | false | string | | containerClassName | className for the outermost container | '' | false | string | | textClassName | className for the top text | '' | false | string | | tickerClassName | className for the container that contains all the sticks | '' | false | string | | tickClassName | className for all the sticks (tall and small both) | '' | false | string | | largeTickClassName | className for the taller sticks | '' | false | string | | tickLabelClassName | className for the label text displayed beneath taller sticks | '' | false | string |

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.