Shaddy Form
A generic, schema-driven React form component for scalable and maintainable form management.
ShaddyForm
is a reusable React component that simplifies form creation and management. It leverages react-hook-form
for state and validation, and uses Zod schemas for type-safe validation. By providing a schema, initial values, and a submit handler, you can quickly generate forms without repetitive boilerplate.
To create a form, simply provide a schema and a submit handler. ShaddyForm will generate the form for you, eliminating the need for boilerplate code. You can also customize the layout to fit your requirements.
If you need access to the form instance outside the form context, use the ref
prop to retrieve it.
Key Features
- Schema-based validation: Uses Zod for robust, type-safe validation.
- Reusable and extensible: Easily integrate with any UI and extend with custom fields.
- Imperative handle: Exposes the form instance via a ref for advanced use cases.
- Flexible validation modes: Supports
onChange
,onBlur
,onSubmit
, andall
.
ShaddyForm acts as a wrapper component for creating forms efficiently.
Installation
pnpm dlx shadcn@latest add https://shaddy-docs.vercel.app/r/shaddy-form