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

@ez-gform/react

v0.1.4

Published

React hooks for submitting to a Google Form without a backend.

Readme

@ez-gform/react

A React hook that submits your own <form> to a Google Form. No backend.

Install

pnpm add @ez-gform/react

Usage

import { useGoogleForm } from "@ez-gform/react";

function ContactForm() {
  const { register, registerCheckbox, submit, status, isSubmitting } =
    useGoogleForm({
      formId: "https://docs.google.com/forms/d/e/1FAIpQLS.../viewform",
    });

  return (
    <form onSubmit={submit}>
      <input aria-label="Your name" {...register("entry.111")} />

      <label>
        <input type="checkbox" {...registerCheckbox("entry.222", "Swimming")} />
        Swimming
      </label>

      <button type="submit" disabled={isSubmitting}>
        {isSubmitting ? "Sending…" : "Send"}
      </button>
      {status === "sent" && <p>Thanks!</p>}
      {status === "error" && <p>Something went wrong.</p>}
    </form>
  );
}

Find your form's entry.N ids with npx @ez-gform/cli <google-form-url>.

Options

| Option | What it does | | --------------- | -------------------------------------------------------------------- | | formId | The form's URL or id. Required. | | schema | A FormSchema (from the CLI). Turns on validation before submit. | | validate | Set false to skip validation even when schema is given. | | initialValues | Starting values, keyed by entry.N. | | resetOnSent | Reset to initialValues after a successful submit. Default false. | | onSent | Called after a submission is sent. | | onError | Called with the result (and validation errors) when something fails. | | mode | "no-cors" (default) or "cors". See below. | | fetch | Custom fetch, for tests or non-browser runtimes. |

Returns

| Field | What it is | | ----------------------------------- | ----------------------------------------------------------- | | register(entryId) | Props for an input, textarea or select. | | registerCheckbox(entryId, option) | Props for one checkbox option. | | submit | Pass to onSubmit, or call it yourself. Returns a promise. | | status | idle, validating, submitting, sent, ok, error. | | isSubmitting | true while a submission is in flight. | | errors | Validation errors: { entryId, message }[]. | | values, setValue, setValues | Read or set values directly. | | reset | Back to initialValues. | | result | The last SubmitResult. | | prefillUrl | Link to the Google Form prefilled with the current values. |

Calling submit() again while one is in flight does not send twice.

"sent" is not "succeeded"

Browsers can't read Google's response (the request is no-cors), so in the browser status stops at "sent": the request went out, but you can't know whether Google accepted it. Outside the browser (Node), pass mode: "cors" to get a real "ok" or "error".