TextInput

The TextInput component extends the functionality of the TextInput element with additional labels.



The regular variant uses the same value for placeholder and label, and has no extended label below.


Try writing in one of the inputs to see the label in action.




Default


Placeholder Text

1import TextInput from '@hummingbot/hbui/components/input/TextInput'
2
3<TextInput
4  placeholder='Placeholder Text'
5  value={inputValue}
6  onChange={yourChangeHandler}
7/>


Valid


Placeholder Text

1import TextInput from '@hummingbot/hbui/components/input/TextInput'
2
3<TextInput
4  isValid
5  placeholder='Placeholder Text'
6  value={inputValue}
7  onChange={yourChangeHandler}
8/>


Warning


Placeholder Text

1import TextInput from '@hummingbot/hbui/components/input/TextInput'
2
3<TextInput
4  isWarning
5  placeholder='Placeholder Text'
6  value={inputValue}
7  onChange={yourChangeHandler}
8/>


Error


Placeholder Text

1import TextInput from '@hummingbot/hbui/components/input/TextInput'
2
3<TextInput
4  isInvalid
5  placeholder='Placeholder Text'
6  value={inputValue}
7  onChange={yourChangeHandler}
8/>




The following variant takes a custom label as label instead of the placeholder, which in this cases works in the standard way, and has no extended label below.


Try writing in the input below to see the label in action.




Custom top label


Custom Top Label

1import TextInput from '@hummingbot/hbui/components/input/TextInput'
2
3<TextInput
4  customTopLabel='Custom Top Label'
5  placeholder='Placeholder Text'
6  value={inputValue}
7  onChange={yourChangeHandler}
8/>






The following variant takes an extended label which appears below. It can be displayed with success, info, warning, and danger styles.




Extended label: Default


Placeholder Text
Bottom Label

1import TextInput from '@hummingbot/hbui/components/input/TextInput'
2
3<TextInput
4  placeholder='Placeholder Text'
5  bottomLabel='Bottom Label'
6  value={inputValue}
7  onChange={yourChangeHandler}
8/>


Extended label: Valid


Placeholder Text
Bottom Label

1import TextInput from '@hummingbot/hbui/components/input/TextInput'
2
3<TextInput
4  isValid
5  placeholder='Placeholder Text'
6  bottomLabel='Bottom Label'
7  value={inputValue}
8  onChange={yourChangeHandler}
9/>


Extended label: Warning


Placeholder Text
Bottom Label

1import TextInput from '@hummingbot/hbui/components/input/TextInput'
2
3<TextInput
4  isWarning
5  placeholder='Placeholder Text'
6  bottomLabel='Bottom Label'
7  value={inputValue}
8  onChange={yourChangeHandler}
9/>


Extended label: Invalid


Placeholder Text
Bottom Label

1import TextInput from '@hummingbot/hbui/components/input/TextInput'
2
3<TextInput
4  isInvalid
5  placeholder='Placeholder Text'
6  bottomLabel='Bottom Label'
7  value={inputValue}
8  onChange={yourChangeHandler}
9/>






The prefix variant has a text prefix preceding the input area.




Your addressPrefix

1import TextInput from '@hummingbot/hbui/components/input/TextInput'
2
3<TextInput
4  placeholder='Placeholder Text'
5  value={inputValue}
6  onChange={yourChangeHandler}
7/>


Since the prefix length may vary, a customPrefixPadding prop is available to allow setting a custom padding size to provide the necessary space for the prefix.


Your addressAverylongprefix

1import TextInput from '@hummingbot/hbui/components/input/TextInput'
2
3<TextInput
4  prefix="Averylongprefix"
5  customPrefixPadding='135px'
6  placeholder="Your address"
7  value={inputValue}
8  onChange={yourChangeHandler}
9/>






The required variant show a red wildcard next to the label.


Try writing in the input below to see the wildcard next to the label.




Required


Placeholder Text*

1import TextInput from '@hummingbot/hbui/components/input/TextInput'
2
3<TextInput
4  required
5  placeholder='Placeholder Text'
6  value={inputValue}
7  onChange={yourChangeHandler}
8/>