@crpt/react-input
v1.0.29
Published
react-input React component
Downloads
34
Keywords
Readme
react-input
React input component.
Usage
import { Input } from "@crpt/react-input";
<Input onChange={newVal => alert("newVal:", newVal)} />
| PropName | Description | Example |
|---|---|---|
| disabled: Boolean | Can be disabled. | <Input disabled />
|
| isError: Boolean | Changes colors to error. | <Input isError={true} />
|
| defaultValue: String | Preset value. | <Input defaultValue="[email protected]" />
|
| placeholder: String | Placeholder value. | <Input placeholder="Имя пользователя" />
|
| onChange: Function | Callback for change event. | <Input onChange={val => alert(val)} />
|
| onUpdate: Function | Fires on enter press or blur. | <Input onUpdate={val => alert(val)} />
|
| onEnterKey: Function | Fires on enter key press. | <Input onEnterKey={val => alert(val)} />
|
| type: String | Input type attribute. For example type="text" and type="password". | <Input type="password" />
|
| rightIcon: String | Right icon. | <Input rightIcon={<Icon type="calendar"/>} />
|
| mask: String | Input mask. | <Input mask="+7 (999) 999-99-99" />
|
| maskOptions: Object | Input mask options. | <Input mask="+7 (999) 999-99-99" maskOptions={{numericInput: true, placeholder: '0'}} />
|