Tech Stack: React, TypeScript, Tailwind CSS, shadcn/ui, Zod, React Hook Form
Features: Auto-generates forms from Zod schemas, supports multiple UI libraries (MUI, Mantine, Ant Design, shadcn/ui)
Customization: Flexible field configurations and custom component support
Documentation: Comprehensive guides and examples available
AutoForm is a React component that automatically generates forms based on your existing Zod schemas. Designed to streamline the process of form creation, AutoForm integrates seamlessly with various UI libraries such as shadcn/ui, Material UI, Mantine, and Ant Design. It leverages React Hook Form for form state management and validation, providing a robust solution for building forms with minimal boilerplate code.
Instant Form Generation: Automatically renders forms from Zod schemas with zero configuration.
Schema Validation: Utilizes Zod for runtime validation and TypeScript type inference.
UI Library Integration: Supports multiple UI libraries, allowing for consistent styling across your application.
Custom Field Configurations: Offers the ability to customize field properties such as labels, placeholders, and validation messages.
Array Support: Handles arrays and nested objects, rendering them as collapsible sections or repeatable groups.
Default Values: Allows setting default values for fields, including arrays and nested objects.
Accessibility: Built with accessibility in mind, ensuring forms are usable by all users.
Extensibility: Provides hooks and utilities for extending functionality and integrating with other libraries.
Rapid Development: Significantly reduces the time spent on form creation by auto-generating forms from schemas.
Type Safety: Ensures type safety and validation through Zod and TypeScript.
Customizable: Offers extensive customization options to tailor forms to your needs.
UI Agnostic: Compatible with various UI libraries, providing flexibility in design choices.
Active Community: Maintained by an active open-source community, ensuring regular updates and support.
Learning Curve: May require a learning curve for developers unfamiliar with Zod or React Hook Form.
Limited Complex Form Support: Not designed for highly complex or dynamic forms with intricate logic.
Dependency Management: Requires careful management of dependencies, especially when integrating with multiple UI
AutoForm provides the following components and templates:
AutoForm: The main component that renders the form based on the provided schema.
AutoFormSubmit: A submit button component that integrates with the form.
Field Components: Pre-built components for various field types such as input, select, checkbox, radio group, switch, textarea, and toggle.
Custom Components: Support for custom field components through the formComponents
prop.
Field Wrappers: Allows for custom field wrappers to control layout and styling.
Validation Utilities: Utilities for integrating validation libraries like Zod, Yup, and Joi.
Array Handlers: Components for handling arrays, including repeatable groups and collapsible sections.
Default Value Handlers: Support for setting and managing default values, including for arrays and nested objects.
AutoForm is open-source and free to use. There are no licensing fees or subscription costs associated with utilizing this component.
AutoForm integrates with the following libraries and frameworks:
UI Libraries: Material UI (@autoform/mui
), Mantine (@autoform/mantine
), Ant Design (@autoform/ant
), shadcn/ui
Schema Libraries: Zod (@autoform/zod
), Yup (@autoform/yup
), Joi (@autoform/joi
)
Form State Management: React Hook Form
Backend Integration: Compatible with backend APIs that utilize Zod for schema validation.
You can integrate AutoForm by installing the desired UI library package and the schema provider package.
Yes, AutoForm supports integration with multiple UI libraries, including Material UI, Mantine, Ant Design, and shadcn/ui.
You can customize field components by passing custom components through the formComponents prop or by using the fieldWrapper option in the field configuration.
Submit your Shadcn product to AllShadcn, get featured, and drive genuine traffic while showcasing your work to the world. Turn your creativity into revenue and begin selling today! 🚀