The DateTimeInput API is experimental and may change in the future. It has been marked as @deprecated to remind the developer that it is experimental. It is not "deprecated", just experimental. Please don't use it in production versions of your app. We do not guarantee backward compatibility, or that the API will remain stable.
This component is returned by useForm().
If you wish to only get a date, with no time, use <PlainDateInput />.

Example

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

export function MeetingForm() {
  const {Form, SubmitButton, Experimental_DateTimeInput} = useForm(
    {
      meetingTime: Forms.dateTime(),
    },
    {}
  )
  return (
    <Form
      onSubmit={async (values) => {
        await showToast({
          title: "Form submitted",
          variant: "success",
          text: `Meeting scheduled for ${values.meetingTime?.toLocaleString()}`,
        })
      }}
    >
      <Experimental_DateTimeInput label="Meeting Time" name="meetingTime" />
      <SubmitButton label="Submit" />
    </Form>
  )
}

Props

label
string
required
The label of the date and time input field.
name
string
required
The path to the dateTime value of the input field in your form schema.e.g. "meeting_time", "user.last_login"
disabled
boolean
Whether or not the field should be disabled.Defaults to false (not disabled).