Forms that
Production-ready form components for React & Next.js. Schema validation, accessible UI, loading states — all wired up and ready to use. Stop rebuilding the same forms.
npm install formcraft— Why FormCraft
Everything you need.
Nothing you don't.
Forms in React are still painful. FormCraft distills years of patterns into a single, coherent package.
Schema-first validation
Powered by Zod with a built-in resolver. Define your schema once — FormCraft handles type inference, validation, and error display automatically.
Accessible by default
Every component ships with ARIA labels, roles, and live regions. Screen readers, keyboard navigation, focus rings — handled from day one.
Multi-step forms
The useMultiStepForm hook gives you step management, per-step validation, and progress tracking. No extra libraries needed.
Drag-and-drop uploads
FileUpload component with type/size validation, multiple file support, preview thumbnails, and full keyboard accessibility.
Form persistence
useFormPersist saves draft state to sessionStorage or localStorage automatically. Users never lose their work.
Auto-save
useFormAutoSave debounces saves and shows last-saved timestamps. Perfect for dashboards and CMS interfaces.
- Live demo
Every feature.
Right here.
Password strength meter, shake on error, terms checkbox — real Zod validation, zero config.
Sign up
- Components
Browse the toolkit.
Preview
↑ Must be at least 3 characters
— Quick start
Up in three steps.
Install the package
Add the stylesheet
Build your first form
— Validation
Zod schemas,
pre-built.
FormCraft ships with commonly-used Zod schemas so you don't rewrite emailSchema, passwordSchema, and phoneSchema for the hundredth time.
emailSchemapasswordSchemaphoneSchemaurlSchemarequiredString()mustBeChecked()loginSchemaregisterSchemaloginSchemaEmail + password with sensible defaults
registerSchemaFull signup with password confirmation
contactSchemaContact form with phone + message
— Hooks
Five hooks.
Infinite forms.
Each hook is purpose-built, tree-shakeable, and fully typed.
Wraps react-hook-form with Zod resolver. Auto-infers types from your schema.
Step management, per-step validation, progress tracking.
Returns score, label, color class, and percentage for a given password string.
Save form state to sessionStorage or localStorage. Exclude sensitive fields.
Debounced auto-save with last-saved timestamp.
— TypeScript
Fully typed.
Zero guessing.
Every prop, hook return value, and schema helper is typed end-to-end. The name prop is typed as FieldPath<TFieldValues> — misspell a field and TypeScript catches it instantly.
— Accessibility
Built for everyone.
Accessibility isn't an afterthought in FormCraft — it's the foundation every component is built on. We test against VoiceOver, NVDA, and JAWS.
WCAG 2.1 AA
Compliant components
Full keyboard navigation
Every component — including FileUpload drag zones — is fully navigable with Tab, Enter, Space, and Arrow keys.
ARIA roles & attributes
aria-invalid, aria-describedby, role='alert', role='radiogroup', role='switch' — set automatically based on state.
Live error regions
Validation errors use aria-live='polite' so screen reader users hear them without focus moving away.
Focus-visible styles
Custom :focus-visible rings that are visible enough for low-vision users but don't interfere with mouse UX.
Reduced motion
The shake animation on error and all transitions respect prefers-reduced-motion via CSS media queries.
Auto-generated IDs
Labels are always linked to inputs via htmlFor/id pairs — auto-generated if you don't supply them.
— Get started
Install once.
Forms forever.
Join developers who stopped rebuilding the same form boilerplate and started shipping faster.
MIT licensed · Peer deps: react ≥18, zod ≥3 · TypeScript-first