Skip to main content
This component is returned by useForm().
Use <TextArea /> when you need a multi-line string field (e.g. descriptions, notes, or comments). For single-line text, use <TextInput /> instead. The component binds to a string field in your form schema.

Example

form-text-area-dialog.tsx
import React from "react"
import {Forms, useForm, showToast} from "attio/client"

export function FormTextAreaDialog() {
  const {Form, SubmitButton, TextArea, TextInput} = useForm(
    {
      title: Forms.string(),
      description: Forms.string(),
    },
    {
      title: "",
      description: "",
    }
  )
  return (
    <Form
      onSubmit={async (values) => {
        await showToast({
          title: "Form submitted",
          variant: "success",
          text: JSON.stringify(values),
        })
      }}
    >
      <TextInput label="Title" name="title" />
      <TextArea
        label="Description"
        name="description"
        placeholder="Enter a description..."
        resizable
      />
      <SubmitButton label="Submit" />
    </Form>
  )
}

Props

label
string
required
The label of the textarea.
name
string
required
The path to the value of the textarea in your form schema.e.g. "description", "address.notes"
placeholder
string
The optional placeholder text of the textarea.
resizable
boolean
Whether the textarea is resizable by the user.Defaults to false.
disabled
boolean
Whether the textarea is disabled.Defaults to false.