Skip to main content

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.

This component is returned by useForm().

Example

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

export function NameDialog() {
  const {Form, SubmitButton, NumberInput} = useForm(
    {
      oneNumber: Forms.number(),
      anotherNumber: Forms.number(),
    },
    {},
  )
  return (
    <Form
      onSubmit={async (values) => {
        await showToast({
          title: "Form submitted",
          variant: "success",
          text: JSON.stringify(values),
        })
      }}
    >
      <NumberInput label="One number" name="oneNumber" />
      <NumberInput label="Another number" name="anotherNumber" />
      <SubmitButton label="Submit" />
    </Form>
  )
}

Props

label
string
required
The label of the input field.
name
string
required
The path to the number value of the input field in your form schema.e.g. "age", "shipping.cost"
placeholder
string
An optional placeholder text for your input.
disabled
boolean
Whether or not the field should be disabled.Defaults to false (not disabled).