TextInput

A general purpose text input field that is used with controlled state manangement.

API Reference

Prop
Type
Default
Description
onChange
React.ChangeEventHandler<HTMLInputElement>
name
string
data-test
string
description
string
disabled
boolean
false
errorMessage
string
id
string
inputMode
'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'
inputRef
React.Ref<HTMLInputElement>
isEmpty
(value: string | number) => boolean
isValid
boolean
true
label
string
loading
boolean
mode
'compact'
onBlur
React.FocusEventHandler<HTMLInputElement>
onClear
React.MouseEventHandler<Element>
onFocus
React.FocusEventHandler<HTMLInputElement>
placeholder
string
required
boolean
false
suffix
string
type
'text' | 'number' | 'tel' | 'search' | 'email' | 'password' | 'date' | 'datetime-local' | 'week'
text
value
string | number

Examples

Default

Number

There are no native html arrows and it blurs when it's focused and user scrolls

Date

Description & Error Message

Disabled

Loading

Suffix

Unlabelled

Compact Mode