> ## 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.

# <Form />

> A component that wraps your form inputs and provides an `onSubmit` handler.

<img className="dark:hidden" width="720" height="440" noZoom src="https://mintcdn.com/attio/4Fh2EPa8-SlLTNAV/images/form.png?fit=max&auto=format&n=4Fh2EPa8-SlLTNAV&q=85&s=3962fbf8ea86242a271fc592ae65bf15" data-path="images/form.png" />

<img className="hidden dark:block" width="720" height="440" noZoom src="https://mintcdn.com/attio/4Fh2EPa8-SlLTNAV/images/form-dark.png?fit=max&auto=format&n=4Fh2EPa8-SlLTNAV&q=85&s=d0f9a10ca04ecf88c8cf1b32ae76faec" data-path="images/form-dark.png" />

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

<Warning>
  You are required to render one – ***and only one*** – of these to make your form work.

  All inputs must be inside of the `<Form />`.
</Warning>

## Example

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

export function FormDialog() {
  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="onSubmit" type="(values) => void | Promise<void>" required>
  What to do with the form values on submit. Typically you will call a server function.

  In TypeScript, the values will be strongly typed to match your [form schema](/sdk/forms/form-schema).
</ParamField>

<ParamField path="children" type="React.ReactNode" required>
  The contents of your form, usually layout and input components.
</ParamField>

<Info>
  A form must contain one – ***and only one*** – [`<SubmitButton />`](./submit-button) as a direct child.
</Info>
