react-restrict-input
v1.0.1
Published
Input that can limit the length and character of user input, support paste and Chinese input
Downloads
3
Readme
react-restrict-input
Input box that can limit the length and character of user input, support paste and Chinese input
Install
npm install --save react-restrict-input
Usage
import React, { Component } from 'react'
import { ReactRestrictInput } from 'react-restrict-input'
const App = () => {
const [value, setValue] = React.useState('')
return (
<ReactRestrictInput
value={value}
onChange={setValue}
maxChars={10}
restrict={/[0-9a-z我]/}
/>
)
}
License
MIT © tkitesy