You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

react-simple-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-simple-input

A simple text input for React

0.2.1
Source
npm
Version published
Weekly downloads
13
160%
Maintainers
1
Weekly downloads
 
Created
Source

react-simple-input

A simple text input for React

Description

react-simple-input is a small text input component with some utilities, like a timeOut before onChange is triggered, a clear button... If there is any feature you want, please open an issue.

Examples

Import it in your project:

import SimpleInput from 'react-simple-input'; // ES6
var SimpleInput = require('react-simple-input'); // ES5

Classic input with a placeholder

<SimpleInput placeholder='search' />

Classic input with a default value and a clear button

<SimpleInput defaultValue='a default value' clearButton />

Input with an onChange function, executing it 250ms after input change

<SimpleInput changeTimeout={250} onChange={ (value) => { console.log(value) } } />

For other props, see options.

Options

PropertyDescriptionDefault value
classNamethe classes you want to pass to the component intput''
classNameContainerthe classes you want to pass to the component container''
defaultValuethe default value of your input''
placeholderthe placeholder you want for your input''
changeTimeoutthe time you want to wait before onChange returns a value (usefull to avoid too many calls to onChange)0
clearButtonAdd a clear button to clear the input in one clickfalse
selectOnClickselect the input text when the input is clickedfalse
onChangethe function called when the input changes() => {}
onClickthe function called when the input is clicked() => {}

Keywords

react

FAQs

Package last updated on 04 Dec 2015

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