This component is returned by useForm().

Example

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

export function EventForm() {
  const {Form, SubmitButton, Experimental_PlainDateInput} = useForm(
    {
      eventDate: Forms.plainDate(),
    },
    {}
  )
  return (
    <Form
      onSubmit={async (values) => {
        await showToast({
          title: "Form submitted",
          variant: "success",
          text: `Event scheduled for ${values.eventDate}`,
        })
      }}
    >
      <Experimental_PlainDateInput label="Event Date" name="eventDate" />
      <SubmitButton label="Submit" />
    </Form>
  )
}

Props

label
string
required
The label of the plain date input field.
name
string
required
The path to the plainDate value of the input field in your form schema.The value will be in ISO 8601 format (YYYY-MM-DD).e.g. "event_date", "user.birth_date"
disabled
boolean
Whether or not the field should be disabled.Defaults to false (not disabled).