Formik

Formik: Build React Forms Without the Tears - Docs & Guide

Library
npm
v2.4.9
34,323stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
53/100Fair
Development Activity0
Maintenance44
Community68
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
75/100Good
Architecture78
Code Quality80
Innovation74
Learning Curve68

Formik is a React library for managing form state, validation, and submission without hand-rolling controlled-input wiring for every field. It centralizes values, touched state, and errors in a single store accessible via hooks (useFormik, useField) or the <Formik> render-prop/component API, so forms of any size stay declarative instead of accumulating dozens of individual useState calls.

Validation can be handled with a plain validation function or, more commonly, a Yup schema passed via validationSchema, giving type-safe, declarative validation rules that Formik automatically maps to per-field error messages. <Field>, <FieldArray>, <Form>, and <ErrorMessage> components cover the common cases of text inputs, dynamic list fields, form submission, and error rendering respectively.

What You Get

  • useFormik/<Formik> - the core hook and component managing values, errors, touched state, and submission handling for an entire form
  • <Field>/useField - per-field bindings that connect an input to Formik’s state without manual onChange/value wiring
  • <FieldArray> - manages dynamic, repeatable field groups (e.g. a list of phone numbers or line items) with add/remove/reorder helpers
  • Built-in Yup schema validation support via validationSchema, plus support for a custom validate function for non-Yup validation
  • withFormik higher-order component for class-component codebases that predate hooks

Common Use Cases

  • Multi-field signup, login, or checkout forms needing per-field validation messages and submit-state handling (isSubmitting, isValid)
  • Dynamic forms where users add/remove repeated groups of fields (e.g. multiple addresses or line items) via FieldArray
  • Forms requiring schema-based validation shared between client and server logic, using a single Yup schema as the source of truth
  • Wizard-style multi-step forms that need to preserve values and validation state as the user moves between steps

Under The Hood

Architecture The core lives in packages/formik/src/Formik.tsx (1219 lines), a single component/hook implementation built around a reducer-style internal state object (values, errors, touched, isSubmitting, isValidating) exposed to descendants through FormikContext; Field.tsx and FastField.tsx connect individual inputs to that context via useField, while FieldArray.tsx (392 lines) layers array-specific mutation helpers (push/remove/insert/swap/move) on top of the same context using an internal array-helpers class. Tech Stack A TypeScript-first monorepo (94% TS) managed with Turborepo/yarn workspaces, containing the formik core package and a separate formik-native package for React Native; validation integrates with Yup as an optional peer, and the build targets both CJS and ESM outputs. Code Quality Test coverage is deep and long-standing: packages/formik/test/ has dedicated suites for Formik.test.tsx, Field.test.tsx, FieldArray.test.tsx, withFormik.test.tsx, ErrorMessage.test.tsx, utils.test.tsx, plus a types.test.tsx file specifically asserting the public TypeScript types compile correctly — an unusually rigorous check for a UI library. E2E coverage is added via Playwright (playwright.config.ts, e2e/ directory) on top of the unit suite. API Design The API balances hooks (useFormik, useField) for modern function components against a still-supported withFormik HOC and render-prop <Formik> component for legacy code, which does add surface area to learn, but the common path (<Formik> + <Field> + validationSchema) requires very little boilerplate to get a validated form working, which explains its dominant adoption in the React ecosystem despite competition from newer, smaller libraries like react-hook-form.

Used by 20 apps in this directory

TypeScript
96%
Other

Amplication

Developer Tools · AI Code Assistants · Automation

16,010

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
61
Repo Health
84
Technical
60
Dependency
Built with
TypeScript96%
Updated 1 months ago
Rust
86%
Other

Arroyo

Data Engineering · Analytics

5,005

A distributed stream processing engine written in Rust that lets you write SQL to run stateful, real-time computations over data streams with subsecond results.

View details
86
Repo Health
74
Technical
62
Dependency
Built with
Rust86%
Updated 1 weeks ago
TypeScript
97%
AGPL 3.0

Bigcapital

Invoicing Finance

3,846

Self-hostable double-entry accounting platform with invoicing, inventory, multi-currency, and real-time financial reporting for small and medium businesses.

View details
91
Repo Health
77
Technical
64
Dependency
Built with
TypeScript97%
Updated yesterday
Go
76%
AGPL 3.0

Coder

Devops · Developer Tools · Code Editors

14,199

Self-hosted cloud development environments and AI coding agents — defined in Terraform, connected via WireGuard, automatically shut down when idle.

View details
93
Repo Health
90
Technical
71
Dependency
Built with
Go76%
TypeScript22%
Updated today
TypeScript
45%
Other

Convex Backend

Developer Tools · Databases

12,394

Open-source reactive database that lets developers build live-updating apps with pure TypeScript, strong consistency, and real-time subscriptions—no separate API layer required.

View details
88
Repo Health
82
Technical
70
Dependency
Built with
TypeScript45%
Rust43%
Updated today
JavaScript
53%
Other

Cosmos-Server

Security · Authentication

6,121

All-in-one self-hosted home server with SmartShield anti-DDoS, Nebula mesh VPN, automatic HTTPS, and a 250-app marketplace — all secured behind a unified auth layer.

View details
79
Repo Health
59
Technical
66
Dependency
Built with
JavaScript53%
Go43%
Updated yesterday
Go
73%
Other

Flipt

Devops · Developer Tools

4,872

Git-native feature flag platform that stores, versions, and deploys feature toggles directly in your own Git repositories with no external database required.

View details
90
Repo Health
83
Technical
70
Dependency
Built with
Go73%
TypeScript26%
Updated today
TypeScript
62%
Other

Flowise

Developer Tools · Automation · No Code Platforms

55,379

Drag-and-drop visual builder for AI agents, RAG pipelines, and multi-agent systems—deploy anywhere in minutes.

View details
91
Repo Health
77
Technical
64
Dependency
Built with
TypeScript62%
JavaScript27%
Updated 6 days ago
Go
61%
Apache 2.0

Harness Open Source

Developer Tools · Devops · Code Editors

38,017

A unified open source DevOps platform combining Git hosting, CI/CD pipelines, cloud development environments, and artifact registries in a single self-hosted system.

View details
89
Repo Health
79
Technical
65
Dependency
Built with
Go61%
TypeScript34%
Updated 2 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search