Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
react-ticker-input
Advanced tools
A minimal reactjs package to render a number input with ticker selectors. 🔥🔥
A minimal reactjs package to render a number input with ticker selectors. 🔥🔥
To see the react number input in action, click here.
OR
To run that demo on your computer:
npm install
npm start
import Ticker from 'react-ticker-input'
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
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.
FAQs
A minimal reactjs package to render a number input with ticker selectors. 🔥🔥
We found that react-ticker-input demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.