What problem does it solve?
This Skill streamlines the creation and management of React forms within an Inertia.js application, ensuring consistency in client-side validation, draft persistence, and server-side error handling.
Core Features & Use Cases
- Unified Form Handling: Integrates Inertia's form capabilities with a shared hook (
useAppForm) for consistent client and server validation.
- Client-Side Validation & Drafts: Provides built-in support for form validation rules and remembers draft form state.
- Dirty-Form Protection: Implements guards to prevent accidental data loss on unsaved changes.
- Consistent Error Display: Manages and displays field-level and summary errors uniformly.
- Toast Notifications: Integrates with Sonner for user feedback on form submission success or failure.
- Use Case: Refactor existing React forms to leverage
useAppForm for improved developer experience and user feedback, especially for forms requiring complex validation or draft saving.
Quick Start
Use the inertia-form-system skill to create a new user edit form with validation and draft saving.