
Security News
Free Certified Patch for Critical Rails Active Storage Vulnerability
Socket has released a free Certified Patch for a critical Rails Active Storage vulnerability, giving developers time to upgrade to a secure Rails version.
@rc-component/input
Advanced tools
import Input from '@rc-component/input';
import { render } from 'react-dom';
render(<Input placeholder="input" allowClear />, mountNode);
| 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-component/input-affix-wrapper' |
| groupClassName | string | - | className with '@rc-component/input-group-wrapper' |
| wrapperClassName | string | - | className with '@rc-component/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 |
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 |
npm install
npm start
@rc-component/input is released under the MIT license.
Provides React input components for formatted numeric values, such as currency and percentages. It is more specialized in number formatting, while @rc-component/input is a general-purpose input building block.
Adds input masks for formats such as phone numbers and dates. It focuses on constraining input patterns rather than providing a broad set of input adornments and variants.
A full React component library whose TextField and Input components offer input controls with labels, validation states, and theming. It is a much broader, styled UI system; @rc-component/input is a more focused, lower-level input package.
Provides a textarea that grows automatically with its content. It focuses on autosizing multiline input, whereas @rc-component/input covers several input types and supporting controls.
FAQs
React input component
The npm package @rc-component/input receives a total of 2,015,036 weekly downloads. As such, @rc-component/input popularity was classified as popular.
We found that @rc-component/input demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.

Security News
Socket has released a free Certified Patch for a critical Rails Active Storage vulnerability, giving developers time to upgrade to a secure Rails version.

Security News
/Threat Research
A malicious Ruby gem runs a credential-stealing worm during installation, poisons AI coding tools, and can wipe files when a stolen GitHub token is revoked.

Security News
GitHub is tightening GitHub Actions security with new restrictions on privileged pull request workflows. Here's what changes and how maintainers are affected.