Skip to content
Harness Design System Harness Design System Harness Design System

TextInput

The TextInput component is used to handle user input, providing options for styling via themes and sizes. Also offers options for adding icons, captions, custom content, and error text for the field.

Usage

import { TextInput } from '@harnessio/ui/components'
//...
return (
<TextInput
label="Success Input"
id="someinput"
value="input with value"
placeholder="Enter the value"
theme="success"
/>
)

API Reference

PropRequiredDefaultType
typefalsetextstring
wrapperClassNamefalsestring
labelfalsestring
captionfalsestring
errorfalsestring
warningfalsestring
optionalfalsefalseboolean
idfalsestring
disabledfalsefalseboolean
classNamefalsestring
inputContainerClassNamefalsestring
themefalse'default''default' | 'success' | 'danger' | 'warning'
sizefalse'default''default' | 'sm'
prefixfalseReactNode
suffixfalseReactNode
valuefalsestring
defaultValuefalsestring
onChangefalseReact.ChangeEventHandler<HTMLInputElement>
placeholderfalsestring
readOnlyfalsefalseboolean