alepha@docs:~/docs/packages/alepha/react$
cat form.md | pretty
1 min read
Last commit:

#Alepha - React Form

#Installation

Part of the alepha package. Import from alepha/react/form.

npm install alepha

#Overview

Type-safe forms with validation.

Features:

  • Form state management
  • Zod schema validation
  • Field-level error handling
  • Submit handling with loading state
  • Form reset

#API Reference

#React Hooks

  • useFieldValue — Hook to subscribe to a single form field's value.
  • useFormQuerySync — Two-way bind a useForm instance to the URL query params, keyed
  • useFormState — Tracks whichever form the caller currently passes in, not only the one
  • useFormValues — Hook to subscribe to all form values.