0.0.4 • Published 2 years ago

alten-react-delayed-input v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Alten react delayed input

This component provides a simple, unstyled input component that can be used like any other. The only difference is that a delay can be specified for triggering the onChange function.

Examples

In this example we are adding a DelayedInput. The onChange function is triggered after 1000ms (1 second). Please note that the newValue in the onChange function is a string.

function App() {

  const [value, setValue] = useState<string>("Test");

  return (
    <div>
        <DelayedInput 
            value={value}
            onChange={(newValue: string) => setValue(newValue)}
            delay={1000} 
        />
    </div>
  );
}

export default App;

Props

All props that can be passed to a regular <input /> component can also be passed to this component. The component has auto complete for all available props.

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago