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.