Form Variants
Different form layouts and patterns — switch stack and implementation mode (JSON Config or Static JSX), then pick a variant. Each demo uses FormConfig with React Hook Form, TanStack Form, or useActionState. Install per variant, e.g. npx afnoui add forms/forms-contact.
Install with:
npx afnoui add forms/forms-job-applicationJob Application
Submitted data
Waiting for a submit…
Submit the form above to see the validated payload rendered here.
Source Code
Required Dependencies & Files
Install packages and copy 25 files to run this form
Dependencies
@hookform/resolvers@tanstack/react-queryaxiosdate-fnsreact-hook-formzod
Dev Dependencies
@types/react@types/react-domtypescript
💡 Using CLI? Shared files are auto-installed
Run npx afnoui form init (or pnpm dlx / yarn dlx / bunx) to scaffold all ● shared files for this stack. You only need to copy ● variant-specific files for your form.
● Variant-specificformConfig.ts, MyFormPage.tsx, formSchema.ts — regenerated per form● Sharedtypes.ts, ReactHookForm.tsx, ReactHookFormField.tsx, … useBackendErrors.ts, field components — install via CLI or copy once
📁forms/formConfig.tsvariant-specific
Your form's JSON configuration — defines structure, fields, validation, and layout.