npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

hookform-action-standalone

v4.0.3

Published

Standalone React adapter for hookform-action – use the same API without Next.js (Vite, Remix, Astro, SPAs).

Readme

hookform-action-standalone

Standalone React adapter for hookform-action — use the same API without Next.js. Works with Vite, Remix, Astro, or any React SPA.

npm version npm downloads license

Using Next.js? Install hookform-action instead for native Server Actions support.

Installation

npm install hookform-action-standalone react-hook-form zod
# or
pnpm add hookform-action-standalone react-hook-form zod

Quick Start

import { useActionForm } from "hookform-action-standalone";
import { z } from "zod";

const schema = z.object({
  email: z.string().email(),
  password: z.string().min(8),
});

export function LoginForm() {
  const {
    register,
    handleSubmit,
    formState: { errors, isPending },
  } = useActionForm({
    submit: async (data) => {
      const res = await fetch("/api/login", {
        method: "POST",
        body: JSON.stringify(data),
        headers: { "Content-Type": "application/json" },
      });
      return res.json();
    },
    schema,
    validationMode: "onChange",
    defaultValues: { email: "", password: "" },
  });

  return (
    <form onSubmit={handleSubmit()}>
      <input {...register("email")} />
      {errors.email && <span>{errors.email.message}</span>}

      <input {...register("password")} type="password" />
      {errors.password && <span>{errors.password.message}</span>}

      <button disabled={isPending}>{isPending ? "Signing in..." : "Sign In"}</button>
    </form>
  );
}

API

useActionForm(options)

| Option | Type | Default | Description | | ------------------- | ---------------------------- | ------------ | ---------------------------------- | | submit | (data) => Promise<TResult> | required | Your async submit function | | defaultValues | DefaultValues<T> | — | Initial form values | | mode | Mode | 'onSubmit' | RHF validation mode | | schema | ZodSchema | — | Client-side Zod schema | | validationMode | ClientValidationMode | 'onSubmit' | When to run client validation | | persistKey | string | — | Enables sessionStorage persistence | | persistDebounce | number | 300 | Debounce interval (ms) | | errorMapper | (result) => errors | Zod format | Custom error extractor | | onSuccess | (result) => void | — | Success callback | | onError | (result \| Error) => void | — | Error callback | | optimisticKey | string | — | Enables optimistic UI | | optimisticData | (current, formData) => T | — | Reducer for optimistic state | | optimisticInitial | T | — | Initial data for optimistic state |

Return Value

Everything from RHF's useForm, plus:

| Property | Description | | ------------------------------ | ---------------------------------- | | handleSubmit(onValid?) | Enhanced submit handler | | formState.isPending | True while submit is in flight | | formState.isSubmitSuccessful | True after success | | formState.submitErrors | Raw server error record | | formState.actionResult | Full submit result | | setSubmitError(field, msg) | Manually set a server error | | persist() | Manually persist to sessionStorage | | clearPersistedData() | Clear persisted data | | optimistic | data, isPending, rollback() |

Differences from hookform-action

| Feature | hookform-action (Next.js) | hookform-action-standalone | | --------------------- | --------------------------- | ------------------------------- | | Submit mechanism | Server Actions | submit function (fetch, etc.) | | formAction | ✅ | — | | Framework requirement | Next.js 14+ | Any React app | | useActionState | ✅ (React 19) | Uses internal state management |

Multi-Step Wizard with Persistence

const form = useActionForm({
  submit: async (data) => saveWizardData(data),
  defaultValues: { name: "", email: "", plan: "" },
  persistKey: "onboarding-wizard",
  persistDebounce: 200,
});

Related Packages

| Package | Description | | ------------------------------------------------------------------------------------ | ---------------------------------- | | hookform-action | Next.js adapter (⭐ main install) | | hookform-action-core | Core library (framework-agnostic) | | hookform-action-devtools | Floating debug panel (FormDevTool) |

Requirements

  • React 18+ (React 19 recommended for optimistic UI)
  • React Hook Form 7.50+
  • Zod 3.22+ (optional)

License

MIT © hookform-action contributors