useFormHandlers
useFormHandlers is a generic form-state hook designed to compose with RapidKit form components.
What It Handles
- field values
- touched state
- field errors
- submit lifecycle
- reset lifecycle
- Zod-compatible schema validation through
safeParse
Login Page Composition Example
The example below demonstrates composing useFormHandlers with RapidKit Input, Checkbox, Button, and Text components.
Authentication Draft
Draft Commit State Sync Example
This example shows using the same handlers in a detail editor where a local draft is validated and then committed to external source-of-truth state.
Source-of-Truth State
This panel represents external source-of-truth data.
Payments API - Platform Team
Critical service for card authorization.Detail State Editor
Uses shared handlers; commits validated draft to source-of-truth on Apply.
Real-Time State Sync Example
This variant pushes changes to external source-of-truth state immediately on each edit (no Apply button).
Source-of-Truth State (Live)
Updates immediately on each change.
Identity Gateway - Security Team
Issues OIDC tokens and validates sessions.Detail State Editor
Uses shared handlers only.
Validation Order
- schema errors are computed first.
- validate errors are merged next.
- validate errors override schema errors on the same field.