rc-input
React input component
Last updated 2 years ago by afc163 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install rc-input 
SYNC missed versions from official npm registry.

rc-input ⌨️

NPM version npm download dumi build status Codecov Dependencies DevDependencies bundle size

Install

rc-input

Usage

import Input from 'rc-input';
import { render } from 'react-dom';

render(<Input placeholder="input" allowClear />, mountNode);

API

Property Type Default Description
prefixCls string rc-input
className string '' additional class name of input
style React.CSSProperties style properties of input
affixWrapperClassName string - className with 'rc-input-affix-wrapper'
groupClassName string - className with 'rc-input-group-wrapper'
wrapperClassName string - className with 'rc-input-wrapper'
addonAfter ReactNode - The label text displayed after (on the right side of) the input field
addonBefore ReactNode - The label text displayed before (on the left side of) the input field
allowClear boolean | { clearIcon: ReactNode } false If allow to remove input content with clear icon
bordered boolean true Whether has border style
defaultValue string - The initial input content
disabled boolean false Whether the input is disabled
id string - The ID for input
maxLength number - The max length
showCount boolean | { formatter: ({ value: string, count: number, maxLength?: number }) => ReactNode } false Whether show text count
prefix ReactNode - The prefix icon for the Input
suffix ReactNode - The suffix icon for the Input
type string text The type of input, see: MDN( use Input.TextArea instead of type="textarea")
value string - The input content value
onChange function(e) - Callback when user input
onPressEnter function(e) - The callback function that is triggered when Enter key is pressed

inputRef

const inputRef = useRef(null);

useEffect(() => {
  inputRef.current.focus();// the input will get focus
  inputRef.current.blur();// the input will lose focus
  console.log(inputRef.current.input);// The origin input element
}, []);
// ....
<Input ref={inputRef} />
Property Type Description
focus (options?: InputFocusOptions) => void The input get focus when called
blur () => void The input loses focus when called
input HTMLInputElement \| null The origin input element

Development

npm install
npm start

License

rc-input is released under the MIT license.

Current Tags

  • 1.6.3                                ...           latest (3 months ago)

44 Versions

  • 1.6.3                                ...           3 months ago
  • 1.6.2                                ...           4 months ago
  • 1.6.1                                ...           4 months ago
  • 1.6.0                                ...           4 months ago
  • 1.5.1                                ...           6 months ago
  • 1.5.0                                ...           6 months ago
  • 1.4.5                                ...           8 months ago
  • 1.4.4                                ...           8 months ago
  • 1.4.3                                ...           a year ago
  • 1.4.2                                ...           a year ago
  • 1.4.1                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.11                                ...           a year ago
  • 1.3.6                                ...           a year ago
  • 1.3.5                                ...           a year ago
  • 1.3.4                                ...           a year ago
  • 1.3.3                                ...           a year ago
  • 1.3.2                                ...           a year ago
  • 1.3.1                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.4                                ...           2 years ago
  • 1.0.4-1                                ...           2 years ago
  • 1.0.4-0                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.2.2                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.1.4                                ...           2 years ago
  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
  • 0.0.1-alpha.7                                ...           3 years ago
  • 0.0.1-alpha.6                                ...           3 years ago
  • 0.0.1-alpha.5                                ...           3 years ago
  • 0.0.1-alpha.4                                ...           3 years ago
  • 0.0.1-alpha.3                                ...           3 years ago
  • 0.0.1-alpha.2                                ...           3 years ago
  • 0.0.1-alpha.1                                ...           3 years ago
  • 0.0.1-alpha.0                                ...           3 years ago
Downloads
Total 4
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (23)

© 2010 - cnpmjs.org x YWFE | Home | YWFE