1.0.1 • Published 3 years ago

react-restrict-input v1.0.1

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

react-restrict-input

Input box that can limit the length and character of user input, support paste and Chinese input

NPM JavaScript Style Guide

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

1.0.1

3 years ago

1.0.0

3 years ago