Installation
How to install and set up Formify in your React project
Installation
This guide walks you through installing Formify in your React project.
Requirements
Before installing Formify, make sure you have:
- React
>= 18(peer dependency) - A package manager: npm, yarn, or pnpm
Formify has zero runtime dependencies — React is the only peer dependency, and no other packages are pulled in at install time.
Installation Options
npm
npm install formify-jsyarn
yarn add formify-jspnpm
pnpm add formify-jsVerifying Installation
After installation, verify Formify resolved correctly:
import { useForm } from "formify-js";
const form = useForm({
initialValues: { email: "" },
validationSchema: { email: { required: true, email: true } },
onSubmit: (values) => console.log(values),
});If your editor provides type autocompletion for useForm, Formify, V, and the rest of the exports, the install succeeded.
Package format
Formify ships dual builds:
| Format | Entry point |
|---|---|
| ESM | ./dist/esm/index.js |
| CJS | ./dist/cjs/index.js |
| Types | ./dist/esm/index.d.ts |
Both formats and full TypeScript declarations are exported from the package root, so bundlers (Vite, Next.js, webpack) and Node.js resolve the correct build automatically.
Things to Know
- Formify requires
react >= 18— it is listed as a peer dependency, so install React separately if your project does not already have it. - The package is marked
sideEffects: false, so tree-shaking works with modern bundlers. - TypeScript types ship with the package — no separate
@types/formify-jspackage exists. - The package includes
README.mdand thedocs/folder in its published files for reference.