TextInput is a single line text input used most often in forms.
import { TextInput } from 'modules/bloom-inputs'
...
<TextInput
label='First Name'
name='firstName'
onChange={(e) => this.props.updateFirstName(e.target.value)}
value={this.props.firstName.value}
/>
import { TextInput } from 'modules/bloom-inputs'
...
const { checkField, formData, updateField } = this.props
<TextArea
formData={formData}
label='First Name'
name='firstName'
onBlur={checkField}
onChange={updateField}
validateAs='not-empty'
/>
label
: Either a string or a React element that labels theTextInput
. Required for accessibility purposes, but hidden by default.name
: A string tying theformData
to the input's value. It should match one of the strings infieldNames
array passed into<Form>
.onChange
: A function used to update theTextInput
's value. Generally, this should beupdateForm
.value
: A string holding the value of theTextInput
. Generally passed in likeformData.field.value
.
className
: A string that styles the input box directly.containerClass
: A string that styles the wrapper around the entire component.error
: A string usually passed in directly fromformData
that notes an error with that field validation. Generally passed in likeformData.field.error
.isPassword
: A boolean that, when true, obfuscates all characters entered into the input and makes them appear as dots.labelClass
: A string that styles only the label text of theTextInput
.placeholder
: A string that shows up in the background of theTextInput
when its value is empty.onBlur
: A function that fires when focus leaves the element. Usually used tocheckField
.onKeyDown
: A function capturing a keydown event.required
: A boolean indicating if the input value can't be empty.showLabel
: A boolean showing or hiding the label text. By default, all bloom forms input labels are hidden.validateAs
: A string tying into the validation help passed in to the wrapper<Form>
. Examples include 'not-empty', 'zip', and 'number'.