Introduce the sicilian
react-hook-form, a widely used form state library in frontend development, operates around refs. That often requires wrapping components with forwardRef or using useFormContext. For many React developers, that constraint can be inconvenient.
sicilian addresses these issues by building on a global state approach. It manages each input as state and helps you write forms in a controlled-component style. Sicilian uses React's Context API internally to manage form state globally, so any component can access and manipulate form state without adding a separate global state library (e.g., Redux, Zustand).
What's new in sicilian@3.1.0#
- Runtime validation support using zod (v3, v4), yup, and superstruct.
- Fixed a bug in register for type="radio".
- Added
validateOptionsas a general replacement forhandleValidate. - Added
handleServerActionto support server actions. - A CLI to generate code snippets quickly has been added. See the
CLI usagepage for details.
Installation#
sicilian can be installed using several methods listed below.
Quick start#
The example below shows basic sicilian usage. It implements a simple login form including validation for email and password fields. See how the sicilian form controller manages state and displays error messages for inputs.