@idot-digital/advanced-input
v1.1.0
Published
React inputs, validating regexp, chars and more. Able to switch between small inputs and textareas.
Downloads
4
Readme
advanced-input
React inputs, validating regexp, chars and more. Able to switch between small inputs and textareas.
Install
npm install --save advanced-input
Usage
import React, { Component } from 'react'
import AdvancedInput from 'advanced-input'
import 'advanced-input/dist/index.css'
class Example extends Component {
render() {
return (
<AdvancedInput
defaultValue={'#'}
value={'test'}
valueSelection={{ start: 2 }}
useTextareaAtLength={20}
regexp={/#([a-fA-F0-9]{3}){1,2}/}
allowedChars={/#|[a-fA-F0-9]/}
dontValidateDuringInput
callback={(input) => console.log(input)}
errorCallback={() => console.log('error')}
extendToTextareaOnLinebreak
placeholder='Some text'
floatingPlaceholder
/>
)
}
}
License
UNLICENSED © @idot-digital