By hassanzohdy
Skills for working with @mongez/react-form — a headless React form handler for Web and React Native. Provides invokable skills for creating form controls, wiring submit buttons, defining validation rules, listening to form events, and React Native usage.
Use when building a new form input component (text, checkbox, radio, select, multi-value, file input, etc.) that needs to register itself with a parent Form or NativeForm. Explains the useFormControl hook contract, the controlled vs uncontrolled paths, the canonical input shape per type, error rendering, and the otherProps pass-through.
Use when the user needs to subscribe to form lifecycle events — to react to submission, validation outcomes, dirty state, reset, or per-control register/unregister. Explains every event in FormEventType, what payload it carries, when it fires relative to others, and how to subscribe and unsubscribe.
@mongez/react-form — headless React form primitives. useFormControl, validation rules, form events, submit-button state. Web + React Native compatible. This page covers install, locale registration for validation messages, and the minimal first form.
Use when integrating @mongez/react-form into a React Native (or Expo) project. Explains the NativeForm component, the Fragment-by-default behavior, programmatic-only submission, how to wire a RN TextInput through useFormControl, and the two cross-platform caveats (auto-touch listener, isVisible).
Idiomatic composition recipes for `@mongez/react-form` — submitting and surfacing backend errors per-field, debounced async field validation, dynamic field arrays with add/remove, multi-step wizard forms with shared state, autosave on dirty, cross-field validation, and sharing rules between Web and React Native.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Headless React form handler for Web and React Native — same hooks, same rules, same <Form> API on both platforms.
react-hook-form is fast because it leans on uncontrolled refs — but its API surface is huge and React Native support requires a separate adapter. formik is controlled by default and re-renders the whole tree on every keystroke. react-final-form works but is effectively unmaintained. Hand-rolling form state with useState per input means you rewrite empty-value handling, dirty tracking, and validation every project.
@mongez/react-form ships one useFormControl hook that owns the value, runs a localized rule pipeline, and registers itself with the nearest <Form> (web) or <NativeForm> (React Native) — same hooks, same rules, on both platforms. Validation rules are plain data objects, not strings, so you can compose them, override messages per instance, or write your own. Dot-notation name props (user.email, addresses.0.city) nest collected values into objects on submit. No schema layer, no <Controller> wrappers, no register("name") boilerplate.
import { Form, useFormControl, requiredRule, emailRule } from "@mongez/react-form";
function TextInput(props) {
const { value, changeValue, error, otherProps } =
useFormControl({ ...props, rules: [requiredRule, emailRule] });
return (
<>
<input value={value} onChange={(e) => changeValue(e.target.value)} {...otherProps} />
{error && <span>{error}</span>}
</>
);
}
<Form onSubmit={({ values }) => api.signup(values)}>
<TextInput name="email" type="email" required />
<button type="submit">Sign up</button>
</Form>
| Feature | Description |
|---|---|
<Form> and <NativeForm> | Concrete components for web (<form> element) and React Native (Fragment + optional component prop). Same context, same hooks. |
useFormControl | Register any input, get back value / changeValue / error / checked / inputRef / otherProps. Always controlled internally. |
Dot-notation name | user.email and addresses.0.city nest into { user: { email }, addresses: [{ city }] } on submit. |
| Composable rule pipeline | Plain InputRule data with validate, requiresType, requiresValue, preservedProps. Built-ins cover required, length, min/max, email, url, pattern, match, strong-password, and more. Async returns supported. |
| Locale-aware errors | Messages flow through @mongez/localization. Bundles ship for en, ar, fr, es, it, de. |
useRadioInput + RadioGroupContext | One useFormControl owns the selected value; each radio reads it through context. |
HiddenInput | One-line component for csrf tokens, hidden ids, computed values. |
useSubmitButton | Subscribes to submitting / invalidControls / dirty events; returns disabled / isSubmitting / isDirty. |
| React Native support | react-native is not a peer dep; NativeForm renders a Fragment unless you pass component={View}. |
BaseForm engine | Abstract class you can subclass to support any React renderer. |
npm install @mongez/react-form
yarn add @mongez/react-form
pnpm add @mongez/react-form
Peer: react >= 18. Runtime deps install transitively: @mongez/events, @mongez/localization, @mongez/supportive-is, @mongez/reinforcements.
import { extend } from "@mongez/localization";
import {
Form, useFormControl, useSubmitButton,
requiredRule, emailRule, enValidationTranslation,
type FormControlProps,
} from "@mongez/react-form";
// 1. Register validation messages once at app entry — without this,
// errors render as raw keys like "validation.required".
extend("en", { validation: enValidationTranslation });
// 2. Build a thin UI wrapper around useFormControl — this is YOUR component.
function TextInput(props: FormControlProps) {
const { value, changeValue, id, error, inputRef, otherProps } =
useFormControl({ rules: [requiredRule, emailRule], ...props });
return (
<>
<input id={id} ref={inputRef} value={value}
onChange={(e) => changeValue(e.target.value)} {...otherProps} />
{error && <span className="error">{error}</span>}
</>
);
}
npx claudepluginhub hassanzohdy/mongez-react-form --plugin mongez-react-formUltra-compressed communication mode. Cuts ~75% of tokens while keeping full technical accuracy by speaking like a caveman.
Frontend design skill for UI/UX implementation
Comprehensive UI/UX design plugin for mobile (iOS, Android, React Native) and web applications with design systems, accessibility, and modern patterns
Memory compression system for Claude Code - persist context across sessions
Marketing skills for AI agents — conversion optimization, copywriting, SEO, paid ads, ad creative, and growth
Standalone image generation plugin using Nano Banana MCP server. Generates and edits images, icons, diagrams, patterns, and visual assets via Gemini image models. No Gemini CLI dependency required.