1.3.0 • Published 5 months ago

@illa-design/input v1.3.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 months ago

Input

The Input component is used to get users input text in it.

Installation

yarn add @illa-design/input

Import component

import { Input } from "@illa-design/input"

API

Input Basic Properties

PropsDescTypeDefault
variantTwo styles of the input box"fill" | "outline""outline"
placeholderThe placeholder show on the input boxstring | string[]-
borderColorColor of the box boarder"white" | "blackAlpha" | "gray" | "grayBlue" | "red" | "orange" | "yellow" | "green" | "blue" | "cyan" | "purple""blue"
defaultValueDefault valuestring | string[]-
disabledIf true, the input box status is disabledbooleanfalse
errorIf true, the input box status is errorbooleanfalse
sizeSize of the box"small" | "medium"| "large""medium"
valueValuestring | string[]-
maxLengthMax leangth of the contentnumber-
showCountShow the word countbooleanfalse
allowClearAllow the delete button to clear the valueboolean-
prefixPrefix inside the boxReactNode-
suffixSuffic inside the boxReactNode-
addonAfterAddon on the right outside the boxReactNode-
addonBeforeAddon on the left outside the boxReactNode-

InputTextArea Basic Properties

PropsDescTypeDefault
placeholderThe placeholder show on the input boxstring | string[]-
defaultValueDefault valuestring | string[]-
disabledIf true, the input box status is disabledboolean-
errorIf true, the input box status is errorbooleanfalse
autoSizeIf true, the size of the box will be automatic adjustboolean| {minRows?:number;maxRows?number}-
valueValuestring | string[]-
maxLengthMax leangth of the contentnumber-
showCountShow the word countbooleanfalse
allowClearAllow the delete button to clear the valueboolean-

InputSearch Basic Properties

PropsDescTypeDefault
searchButtonIf true, the search button show on outside of the boxbooleanfalse
variantTwo styles of the input box"fill" | "outline""outline"
placeholderThe placeholder show on the input boxstring | string[]-
defaultValueDefault valuestring | string[]-
disabledIf true, the input box status is disabledboolean-
borderColorColor of the box boarder"white" | "blackAlpha" | "gray" | "grayBlue" | "red" | "orange" | "yellow" | "green" | "blue" | "cyan" | "purple""blue"
errorIf true, the input box status is errorbooleanfalse
sizeSize of the box"small" | "medium" | "large""medium"
valueValuestring | string[]-
allowClearAllow the delete button to clear the valueboolean-

InputPassword Basic Properties

PropsDescTypeDefault
invisibleButtonIf true, the invisible button show on the right of the boxbooleantrue
variantTwo styles of the input box"fill" | "outline""outline"
placeholderThe placeholder show on the input bostring | string[]-
defaultValueDefault valuestring | string[]-
disabledIf true, the input box status is disabledboolean-
borderColorColor of the box boarder"white" | "blackAlpha" | "gray" | "grayBlue" | "red" | "orange" | "yellow" | "green" | "blue" | "cyan" | "purple""blue"
errorIf true, the input box status is errorbooleanfalse
sizeSize of the box"small" | "medium" | "large""medium"
valueValuestring | string[]-
allowClearAllow the delete button to clear the valueboolean-

Input Events

PropsDescTypeDefault
onChangeWhen the content change(event) => void-
onPressEnterWhen press the Enter(event) => void-
onClearWhen click the delete button() => void-
onFocusWhen the input box on focus(event) => void-
onBlurWhen the input box on blur(event) => void-
onSearchWhen click the search button(value:string) => void-

Input Methods

PropsDescTypeDefault
focusGet the input box focus--
blurGet 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

5 months ago

1.3.0

5 months ago

1.0.29

10 months ago

1.0.28

10 months ago

1.0.27

11 months ago

1.0.31

9 months ago

1.0.30

10 months ago

1.1.0

8 months ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.26

12 months ago

1.0.25

12 months ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.20

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

2 years ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.9

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.8

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago