Skip to main content

Example

form-with-divider.tsx
import React from "react"
import {Forms, useForm, showToast, Divider} from "attio/client"

export function FormWithDividerDialog() {
  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" />
      <Divider />
      <TextInput label="Last name" name="lastName" />
      <SubmitButton label="Submit" />
    </Form>
  )
}
It can be thought of as an <hr /> in HTML.

Props

None