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

# <Toggle />

> A toggle input field.

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

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

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

## Example

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

export function ApprovalDialog() {
  const {Form, SubmitButton, Toggle} = useForm(
    {
      approved: Forms.boolean(),
    },
    {
      approved: false,
    },
  )
  return (
    <Form
      onSubmit={async (values) => {
        await showToast({
          title: "Form submitted",
          variant: "success",
          text: values.approved ? "Approved" : "Not approved",
        })
      }}
    >
      {/* Some information here */}
      <Toggle label="Approved" name="approved" />
      <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 `boolean` value of the input field in your [form schema](../../forms/form-schema).

  e.g. `"is_active"`, `"shipping.is_express"`
</ParamField>

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

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