Overview
Crustack Form is a simple and flexible solution for building accessible forms. It is TypeScript-first and fully headless, giving you complete control over your UI.
Installation
Motivation
Many existing form solutions overlook accessibility, prioritizing only state management. Crustack Form, however, places accessibility as its primary focus.
Comprehensive type safety is a fundamental requirement. Every aspect of the form, from hooks to components, is designed to be strictly type-safe, addressing the often loose typing found in other libraries.
Crustack Form also aims to streamline the form validation process. While other solutions may offer numerous, sometimes confusing, validation methods, Crustack Form provides a straightforward and non-redundant approach.
Show me some code!
Let's build a basic form that demonstrates key features of Crustack Form. The form contains two fields - title and description. Each field includes:
- A label for accessibility
- A descriptive helper text
- An input control with validation
- Error message display
The form also showcases:
- Real-time validation feedback
- Error summary with quick navigation
- Success/failure submission states
Here's the code: