> ## Documentation Index
> Fetch the complete documentation index at: https://docs.attio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# <TextInput />

> A string input field.

<img className="dark:hidden" width="720" height="440" noZoom src="https://mintcdn.com/attio/2EyaTyByKNPeSVcd/images/text-input.png?fit=max&auto=format&n=2EyaTyByKNPeSVcd&q=85&s=d9ddcff4dfc0cd124c18fa2aa1e418bf" data-path="images/text-input.png" />

<img className="hidden dark:block" width="720" height="440" noZoom src="https://mintcdn.com/attio/2EyaTyByKNPeSVcd/images/text-input-dark.png?fit=max&auto=format&n=2EyaTyByKNPeSVcd&q=85&s=578881e9e0b69e1cbb06aaa7622e1c2b" data-path="images/text-input-dark.png" />

<Note>This component is returned by [`useForm()`](../../forms/use-form).</Note>

Use `<TextInput />` for single-line string fields. For multi-line text (e.g. descriptions, notes, or comments), use [`<TextArea />`](./text-area) instead. The component binds to a `string` field in your [form schema](../../forms/form-schema).

## Example

```tsx form-text-input-dialog.tsx theme={"system"}
import React from "react"
import {Forms, useForm, showToast} from "attio/client"

export function FormTextInputDialog() {
  const {Form, SubmitButton, TextInput} = useForm(
    {
      firstName: Forms.string(),
      lastName: Forms.string(),
    },
    {
      firstName: "",
      lastName: "",
    },
  )
  return (
    <Form
      onSubmit={async (values) => {
        await showToast({
          title: "Form submitted",
          variant: "success",
          text: JSON.stringify(values),
        })
      }}
    >
      <TextInput label="First name" name="firstName" />
      <TextInput label="Last name" name="lastName" />
      <SubmitButton label="Submit" />
    </Form>
  )
}
```

## Props

<ParamField path="label" type="string" required>
  The label of the input field.
</ParamField>

<ParamField path="name" type="string" required>
  The path to the `string` value of the input field in your [form schema](../../forms/form-schema).

  e.g. `"name"`, `"shipping.address.street"`
</ParamField>

<ParamField path="type" type="'text' | 'email' | 'password' | 'tel' | 'url'">
  The type of the input field.

  They roughly correspond to the HTML types
  [`text`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text),
  [`email`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email),
  [`password`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/password),
  [`tel`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/tel), and
  [`url`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/url).

  Defaults to `"text"`.
</ParamField>

<Tip>Useful on mobile devices with virtual keyboards.</Tip>

<ParamField path="placeholder" type="string">
  An optional placeholder text for your input.
</ParamField>

<ParamField path="disabled" type="boolean">
  Whether or not the field should be disabled.

  Defaults to `false` (not disabled).
</ParamField>
