New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@rc-component/input

Package Overview
Dependencies
Maintainers
5
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rc-component/input

React input component

latest
Source
npmnpm
Version
1.3.0
Version published
Weekly downloads
462K
11.5%
Maintainers
5
Weekly downloads
 
Created
Source

@rc-component/input ⌨️

NPM version npm download build status Codecov bundle size dumi

Install

@rc-component/input

Usage

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

render(<Input placeholder="input" allowClear />, mountNode);
import Input from '@rc-component/input';
import { render } from 'react-dom';

render(<Input.TextArea autoSize showCount />, mountNode);

API

PropertyTypeDefaultDescription
prefixClsstringrc-input
classNamestring''additional class name of input
styleReact.CSSPropertiesstyle properties of input
affixWrapperClassNamestring-className with '@rc-component/input-affix-wrapper'
groupClassNamestring-className with '@rc-component/input-group-wrapper'
wrapperClassNamestring-className with '@rc-component/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

TextArea

rc-textarea has been migrated into @rc-component/input. Use Input.TextArea or the named TextArea export for all textarea-related features.

import Input, { TextArea } from '@rc-component/input';

<Input.TextArea allowClear autoSize />;
<TextArea showCount maxLength={100} />;
PropertyTypeDefaultDescription
prefixClsstringrc-textarea
classNamestring''additional class name of textarea
styleReact.CSSProperties-style properties of textarea
autoSizeboolean | object-Height autosize feature, can be set to true|false or an object { minRows: 2, maxRows: 6 }
allowClearboolean | { clearIcon }falseIf allow to remove textarea content with clear icon
showCountboolean | { formatter }falseWhether show text count
countCountConfig-Custom count strategy / max / exceed formatter
onPressEnterfunction(e)-The callback function that is triggered when Enter key is pressed
onResizefunction({ width, height })-The callback function that is triggered when resize

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

textareaRef

const textareaRef = useRef(null);

useEffect(() => {
  textareaRef.current.focus();
  textareaRef.current.blur();
  console.log(textareaRef.current.resizableTextArea);
}, []);

<Input.TextArea ref={textareaRef} />;
PropertyTypeDescription
focus() => voidThe textarea get focus when called
blur() => voidThe textarea loses focus when called
resizableTextAreaResizableTextAreaRefWrapped resizable textarea instance
nativeElementHTMLElement | nullThe outer holder element or textarea DOM

Development

npm install
npm start

License

@rc-component/input is released under the MIT license.

Keywords

react

FAQs

Package last updated on 20 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts