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 13 files to run this form
Dependencies
react-hook-form@hookform/resolverszodaxioslucide-react@tanstack/react-query
Dev Dependencies
typescript@types/react@types/react-dom
π‘ 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
π@/pages/MyFormPage.tsxvariant-specific
Form page component