1.7.3 • Published 4 months ago

rc-input v1.7.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

rc-input ⌨️

NPM version npm download build status Codecov bundle size dumi

Install

rc-input

Usage

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

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

API

PropertyTypeDefaultDescription
prefixClsstringrc-input
classNamestring''additional class name of input
styleReact.CSSPropertiesstyle properties of input
affixWrapperClassNamestring-className with 'rc-input-affix-wrapper'
groupClassNamestring-className with 'rc-input-group-wrapper'
wrapperClassNamestring-className with 'rc-input-wrapper'
addonAfterReactNode-The label text displayed after (on the right side of) the input field
addonBeforeReactNode-The label text displayed before (on the left side of) the input field
allowClearboolean | { clearIcon: ReactNode }falseIf allow to remove input content with clear icon
borderedbooleantrueWhether has border style
defaultValuestring-The initial input content
disabledbooleanfalseWhether the input is disabled
idstring-The ID for input
maxLengthnumber-The max length
showCountboolean | { formatter: ({ value: string, count: number, maxLength?: number }) => ReactNode }falseWhether show text count
prefixReactNode-The prefix icon for the Input
suffixReactNode-The suffix icon for the Input
typestringtextThe type of input, see: MDN( use Input.TextArea instead of type="textarea")
valuestring-The input content value
onChangefunction(e)-Callback when user input
onPressEnterfunction(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} />
PropertyTypeDescription
focus(options?: InputFocusOptions) => voidThe input get focus when called
blur() => voidThe input loses focus when called
inputHTMLInputElement \| nullThe origin input element

Development

npm install
npm start

License

rc-input is released under the MIT license.

1.6.4

7 months ago

1.7.3

4 months ago

1.7.2

5 months ago

1.7.1

7 months ago

1.7.0

7 months ago

1.6.3

10 months ago

1.6.2

11 months ago

1.6.1

11 months ago

1.6.0

11 months ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.5

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.11

2 years ago

1.3.6

2 years ago

1.2.0

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.4-1

2 years ago

1.0.4-0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 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