Text Input

The Text Input component is used for single-line text input with support for icons, password toggle and more.

Usage

Default


const [value, setValue] = useState("");

<TextInput
  value={value}
  onChange={(e) => setValue(e.target.value)}
  placeholder="Enter text..."
/>

Props

Sortable data table
PropTypeDefaultDescription
placeholderstringEnter textPlaceholder text when the input is empty.
passwordbooleanfalseIf true, renders the input as a password field with toggle.
readOnlybooleanfalseIf true, the input is read-only.
disabledbooleanfalseDisables the input field.
autocompletebooleanfalseIf true, enables browser autocomplete.
outlinebooleanfalseIf true, renders an outlined variant of the input.
iconReact.ElementType-Optional icon displayed inside the input field.
theme"primary" | "secondary" | "tertiary" | "quaternary" | "clear"Configured DefaultTheme for the input's appearance.
rounding"none" | "small" | "medium" | "large"Configured DefaultBorder radius for the input field.
shadow"none" | "light" | "medium" | "strong" | "intense"Configured DefaultBox shadow style for the input field.
state"success" | "error" | "warning"-Validation state appearance for the input.
ariaLabelstring-Custom ARIA label for accessibility.
ariaDescriptionstring-Custom ARIA description for screen readers.
data-testidstring"text-input"Test ID for the root element (for testing utilities).