---
title: "Text field"
description: "Use the text field to allow a user to input a single line of text."
sidebar_label: "Text field"
slug: /reference/components/text-field
---

import ComponentDemo from '@site/src/components/ComponentDemo';

# Text field

Use the text field to allow a user to input a single line of text.

**Package:** `@terreno/ui`  
**Categories:** Component  
**Props interface:** `TextFieldProps`  
**Story source:** [`demo/stories/Textfield.stories.tsx`](https://github.com/flourishhealth/terreno/blob/master/demo/stories/Textfield.stories.tsx)

## Live demo

<ComponentDemo name="Text field" />

## Props

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `onChange` | `OnChangeCallback` | Yes |  |
| `aiSuggestion` | `AiSuggestionProps` |  |  |
| `autoComplete` | `union` |  |  |
| `blurOnSubmit` | `boolean` |  |  |
| `disabled` | `boolean` |  |  |
| `errorText` | `string` |  |  |
| `grow` | `boolean` |  |  |
| `helperText` | `string` |  |  |
| `iconName` | `IconName` |  |  |
| `id` | `string` |  |  |
| `inputRef` | `reflection` |  |  |
| `multiline` | `boolean` |  |  |
| `onBlur` | `OnChangeCallback` |  |  |
| `onEnter` | `reflection` |  |  |
| `onFocus` | `reflection` |  |  |
| `onIconClick` | `reflection` |  |  |
| `onSubmitEditing` | `reflection` |  |  |
| `placeholder` | `string` |  |  |
| `returnKeyType` | `union` |  |  |
| `rows` | `number` |  |  |
| `testID` | `string` |  | Root test id for the primary interactive element or container. |
| `testIDs` | `FieldTestIDs` |  |  |
| `title` | `string` |  |  |
| `trimOnBlur` | `boolean` |  |  |
| `type` | `union` |  |  |
| `value` | `string` |  |  |
