Skip to content

FormDevTools API Reference

The FormDevTools component is a developer tool that helps you debug forms in your application. It shows you the current state of your form, including the values, errors, and fields. To use the FormDevTools component, you need to wrap it with the FormProvider you want to debug.

tsx
import {useForm} from '@formsignals/form-react';
import {FormDevTools} from '@formsignals/dev-tools-react';

export default function App() {
  const form = useForm();

  return (
    <form.FormProvider>
      <FormDevTools/>
      {/* Your form components */}
    </form.FormProvider>
  );
}

Options

When creating the FormDevTools component, you can pass an options object to customize its behavior.

ts
type FormDevToolsProps = {
  bgColor?: string
  bgSecondaryColor?: string
  textColor?: string
  accentColor?: string
  onAccentColor?: string
  errorColor?: string
  successColor?: string

  initialOpen?: boolean
  position?: `${'top' | 'bottom'}-${'left' | 'right'}`
}
OptionDescription
bgColorThe background color of the devtools.
bgSecondaryColorThe secondary background color of the devtools.
textColorThe text color of the devtools.
accentColorThe accent color of the devtools.
onAccentColorThe color of the text on the accent color.
errorColorThe color of the falsy values.
successColorThe color of the truthy values.
initialOpenWhether the devtools should be open by default. Default: false
positionThe position of the devtools. Default: bottom-right