1.3.0 • Published 2 years ago
@illa-design/input v1.3.0
Input
The Input component is used to get users input text in it.
Installation
yarn add @illa-design/inputImport component
import { Input } from "@illa-design/input"API
Input Basic Properties
| Props | Desc | Type | Default |
|---|---|---|---|
| variant | Two styles of the input box | "fill" | "outline" | "outline" |
| placeholder | The placeholder show on the input box | string | string[] | - |
| borderColor | Color of the box boarder | "white" | "blackAlpha" | "gray" | "grayBlue" | "red" | "orange" | "yellow" | "green" | "blue" | "cyan" | "purple" | "blue" |
| defaultValue | Default value | string | string[] | - |
| disabled | If true, the input box status is disabled | boolean | false |
| error | If true, the input box status is error | boolean | false |
| size | Size of the box | "small" | "medium"| "large" | "medium" |
| value | Value | string | string[] | - |
| maxLength | Max leangth of the content | number | - |
| showCount | Show the word count | boolean | false |
| allowClear | Allow the delete button to clear the value | boolean | - |
| prefix | Prefix inside the box | ReactNode | - |
| suffix | Suffic inside the box | ReactNode | - |
| addonAfter | Addon on the right outside the box | ReactNode | - |
| addonBefore | Addon on the left outside the box | ReactNode | - |
InputTextArea Basic Properties
| Props | Desc | Type | Default |
|---|---|---|---|
| placeholder | The placeholder show on the input box | string | string[] | - |
| defaultValue | Default value | string | string[] | - |
| disabled | If true, the input box status is disabled | boolean | - |
| error | If true, the input box status is error | boolean | false |
| autoSize | If true, the size of the box will be automatic adjust | boolean| {minRows?:number;maxRows?number} | - |
| value | Value | string | string[] | - |
| maxLength | Max leangth of the content | number | - |
| showCount | Show the word count | boolean | false |
| allowClear | Allow the delete button to clear the value | boolean | - |
InputSearch Basic Properties
| Props | Desc | Type | Default |
|---|---|---|---|
| searchButton | If true, the search button show on outside of the box | boolean | false |
| variant | Two styles of the input box | "fill" | "outline" | "outline" |
| placeholder | The placeholder show on the input box | string | string[] | - |
| defaultValue | Default value | string | string[] | - |
| disabled | If true, the input box status is disabled | boolean | - |
| borderColor | Color of the box boarder | "white" | "blackAlpha" | "gray" | "grayBlue" | "red" | "orange" | "yellow" | "green" | "blue" | "cyan" | "purple" | "blue" |
| error | If true, the input box status is error | boolean | false |
| size | Size of the box | "small" | "medium" | "large" | "medium" |
| value | Value | string | string[] | - |
| allowClear | Allow the delete button to clear the value | boolean | - |
InputPassword Basic Properties
| Props | Desc | Type | Default |
|---|---|---|---|
| invisibleButton | If true, the invisible button show on the right of the box | boolean | true |
| variant | Two styles of the input box | "fill" | "outline" | "outline" |
| placeholder | The placeholder show on the input bo | string | string[] | - |
| defaultValue | Default value | string | string[] | - |
| disabled | If true, the input box status is disabled | boolean | - |
| borderColor | Color of the box boarder | "white" | "blackAlpha" | "gray" | "grayBlue" | "red" | "orange" | "yellow" | "green" | "blue" | "cyan" | "purple" | "blue" |
| error | If true, the input box status is error | boolean | false |
| size | Size of the box | "small" | "medium" | "large" | "medium" |
| value | Value | string | string[] | - |
| allowClear | Allow the delete button to clear the value | boolean | - |
Input Events
| Props | Desc | Type | Default |
|---|---|---|---|
| onChange | When the content change | (event) => void | - |
| onPressEnter | When press the Enter | (event) => void | - |
| onClear | When click the delete button | () => void | - |
| onFocus | When the input box on focus | (event) => void | - |
| onBlur | When the input box on blur | (event) => void | - |
| onSearch | When click the search button | (value:string) => void | - |
Input Methods
| Props | Desc | Type | Default |
|---|---|---|---|
| focus | Get the input box focus | - | - |
| blur | Get the input box focus | - | - |
Example
Basic usage
<Input />
<Input placeholder="test-disabled" disabled />Set input box's size
<Input variant="fill" size="small" />Set prefix and add-on
<Input
placeholder="variant-fill"
prefix={"prefix"}
addonBefore={"addonBefore"}
/>Set default value and max length
<Input defaultValue="test maxLength" maxLength={4} />Set word count
<Input placeholder="showCount" maxLength={4} showCount />Set password input box
<Password placeholder="variant-fill" variant="fill" />Set search input box
<Search placeholder="variant-fill" variant="fill" />Set text area input box
<TextArea placeholder="defaultValue" defaultValue="test defaultValue" />1.2.0
2 years ago
1.3.0
2 years ago
1.0.29
2 years ago
1.0.28
2 years ago
1.0.27
2 years ago
1.0.31
2 years ago
1.0.30
2 years ago
1.1.0
2 years ago
1.0.22
2 years ago
1.0.21
2 years ago
1.0.26
2 years ago
1.0.25
2 years ago
1.0.24
2 years ago
1.0.23
2 years ago
1.0.19
3 years ago
1.0.18
3 years ago
1.0.17
3 years ago
1.0.20
3 years ago
1.0.16
3 years ago
1.0.15
3 years ago
1.0.14
3 years ago
1.0.9
3 years ago
1.0.8
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.11
3 years ago
1.0.10
3 years ago
1.0.13
3 years ago
1.0.12
3 years ago
1.0.5
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago
0.0.10
3 years ago
0.0.11
3 years ago
0.0.12
3 years ago
0.0.13
3 years ago
0.0.14
3 years ago
0.0.15
3 years ago
0.0.9
3 years ago
0.0.16
3 years ago
0.0.17
3 years ago
0.0.8
3 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
4 years ago