Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,47 +40,47 @@ render(<Input placeholder="input" allowClear />, mountNode);
```

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

render(<Input.TextArea autoSize showCount />, mountNode);
render(<TextArea autoSize showCount />, 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-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 &#124; { 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 &#124; { 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](https://developer.mozilla.org/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types)( 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 |
| 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 &#124; { 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 &#124; { 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](https://developer.mozilla.org/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types) (use the named `TextArea` export 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 |

## TextArea

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

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

<Input.TextArea allowClear autoSize />;
<TextArea showCount maxLength={100} />;
<TextArea allowClear autoSize />;
```

| Property | Type | Default | Description |
Expand Down Expand Up @@ -126,7 +126,7 @@ useEffect(() => {
console.log(textareaRef.current.resizableTextArea);
}, []);

<Input.TextArea ref={textareaRef} />;
<TextArea ref={textareaRef} />;
```

| Property | Type | Description |
Expand Down