Skip to content
OTF Kit logoOTF Kit

Auto Form

Input

Schema-driven auto-generated form from a Zod schema — labels, helpers, and validation.

View in Storybook
Auto Form
Loading Storybook preview…

Installation

bun add @otfdashkit/ui

Usage

Import AutoForm from @otfdashkit/ui.

Code
// Auto Form — Schema-driven auto-generated form from a Zod schema — labels, helpers, and validation.
//
// Install:
//   bun add @otfdashkit/ui

import { AutoForm } from '@otfdashkit/ui'

export function Example() {
  return (
    <AutoForm>
      {/* your content */}
    </AutoForm>
  )
}

Props

Props declared in the AutoForm source. Inherited HTML attributes are not listed.

PropTypeDefaultDescription
onSubmitrequired(data: Record<string, unknown>) => void
schemarequiredZodObject<Readonly<{ [k: string]: $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>; }>, $strip>
defaultValuesRecord<string, unknown>
submitLabelstring'Submit'

Related