PACKAGE · FORM

final-form

🏁 Framework agnostic, high performance, subscription-based form state management

WEEKLY DOWNLOADS 293.3K
STARS 3.0K
FORKS 223
OPEN ISSUES 104
GZIP SIZE 7.3 kB
UNPACKED SIZE 438.8 kB
DEPENDENCIES 2
LAST UPDATED 1y ago
DOWNLOAD TRENDS

final-form downloads — last 12 months

Download trends for final-form1 download series from Jun 2025 to May 2026. Use left and right arrow keys to inspect monthly values.0695.6K1.4M2.1M2.8MJun 2025SepDecMarMay 2026
final-form
ABOUT FINAL-FORM

Final Form addresses the complexities of managing form state in modern web applications by providing a high-performance, subscription-based state management library. It is designed to tackle the common challenges of handling user input, validation, submission, and reset operations efficiently, especially in dynamic and interactive user interfaces.

The core philosophy behind Final Form is to offer a lightweight yet powerful engine for form state, prioritizing performance and flexibility. It's built for developers who need fine-grained control over their forms without the overhead of heavier, framework-specific solutions. The library is framework-agnostic, making it suitable for a wide range of JavaScript environments.

The API is built around a declarative approach, encouraging the use of hooks like `useForm` and subscriptions to manage form state. Key concepts include `form.change`, `form.submit`, and `form.reset`, along with powerful validation features that can be asynchronous. The subscription mechanism allows components to opt into receiving only the specific parts of the form state they need, preventing unnecessary re-renders.

Final Form integrates seamlessly with popular JavaScript frameworks such as React, Angular, and Vue, often through dedicated adapter libraries. Its agnostic nature means it can be dropped into existing projects or used as the foundation for new applications, regardless of the primary framework choice. This makes it a versatile tool for managing form logic across diverse tech stacks.

With a notably small bundle size of 7.3 kB (gzip), Final Form is an attractive option for performance-sensitive applications. Its subscription-based model contributes to efficient re-renders, ensuring that only relevant UI elements update when form state changes. The library has been available for a significant period, indicating maturity and stability in its core functionality.

While highly flexible, Final Form expects developers to manage the integration and UI rendering themselves, often requiring more boilerplate code compared to form libraries tightly coupled with specific UI frameworks. Developers also need to understand its subscription model to fully leverage its performance benefits, as misusing subscriptions can lead to unexpected behavior or performance degradation.

WHEN TO USE
  • When managing complex form validation logic, including asynchronous validation rules.
  • To optimize form re-renders by subscribing only to necessary state fields using `form.subscribe`.
  • When building forms with a large number of fields where performance is critical.
  • In multi-framework or framework-agnostic projects requiring a consistent form management solution.
  • To separate form logic from UI components for better testability and maintainability.
  • When integrating forms into server-rendered applications where client-side hydration efficiency is important.
  • To handle intricate form submission states, including loading, error, and success indicators.
WHEN NOT TO USE
  • If your needs are limited to very simple forms with minimal state and no validation, built-in browser form APIs or a lighter state management solution might suffice.
  • When a completely declarative, DOM-centric approach to form management is preferred without explicit state subscriptions.
  • If the project heavily relies on a specific UI framework's opinionated form handling and you wish to avoid an additional abstraction layer.
  • For scenarios where offline form capabilities are the primary requirement, as Final Form focuses on client-side state management.
  • If abstracting away all form-related concerns into a single, high-level API is the main goal and fine-grained control is not desired.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 3
final-form vs @tanstack/react-form ★ 6.6K · 947.9K/wk final-form vs formik ★ 34.4K · 1.9M/wk final-form vs react-hook-form ★ 44.8K · 27.0M/wk