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

@explita/daily-toolset-form

v0.0.2

Published

A lightweight form toolkit for React built with developer ergonomics in mind. Includes a flexible Form component, useForm, useField, and useFormContext hooks for managing form state and validation with ease. Designed to simplify complex forms while remain

Readme

@explita/daily-toolset-form

A powerful and extensible React form hook for building scalable forms with Zod validation, persistence, and full control.

✨ Features

  • ✅ Built-in Zod schema validation
  • ✅ Controlled and uncontrolled modes
  • ✅ Persistent form state via localStorage
  • ✅ Field-level error handling and parsing
  • ✅ Debounced input validation
  • ✅ Works seamlessly with any UI library (e.g. shadcn/ui)

📦 Installation

npm install @explita/daily-toolset-form
# or
yarn add @explita/daily-toolset-form

🧪 Usage

import { z } from "zod";
import { useForm, Form, Field } from "@explita/daily-toolset-form";
import { Input } from "@/components/ui/input";

const schema = z.object({
  email: z.email({ error: "Invalid email" }),
  password: z
    .string()
    .min(6, { error: "Password must be at least 6 characters" }),
});

export default function LoginForm() {
  const form = useForm({
    schema,
    defaultValues: { email: "", password: "" },
    onSubmit: async (values) => {
      console.log("Submitted", values);
      // call server action here or perform an HTTP request
      // const response = await login(values)
      // return response
      return values;
    },
    onSuccess: (result, ctx) => {
      console.log("Success", result);
      // result is the result of onSubmit
      // ctx.reset(); - reset the form, you don't need this if resetOnSuccess is true
    },
    onError: (error, ctx) => {
      console.log("Error", error, ctx);
      // error - the error object (usually from schema or server)
      // ctx.setErrors({ email: "Email is required" }); - useful for server errors
    },
    persistKey: "login-form", // Optional – saves input across reloads
    errorParser: (msg) => msg, // Optional – customize error messages
    mode: "controlled", // Optional – "controlled" is the default
    resetOnSuccess: true, // Optional – clears the form on success
  });

  //Field meta is an object that contains the value, error, and hasError properties

  return (
    <Form use={form}>
      <Field name="email" label="Email" isRequired>
        {(props, meta) => <Input {...props} />}
      </Field>

      <Field name="password" label="Password" isRequired>
        {(props, meta) => <Input type="password" {...props} />}
      </Field>

      <button type="submit" disabled={form.isSubmitting}>
        Submit
      </button>
    </Form>
  );
}

🧩 API Overview

useForm(options)

| Option | Type | Description | | ---------------- | ------------------------------------- | ------------------------------------------- | | schema | ZodObject | Optional Zod schema for validation | | defaultValues | Partial<T> | Initial form values | | onSubmit | (values, formData) => Promise<void> | Async submission handler | | onSuccess | (result) => void | Called on successful submission | | onError | (error, ctx) => void | Called on error, with access to setErrors | | persistKey | string | Key to store form values under | | errorParser | (msg: string) => string | Optional formatter for error messages | | mode | controlled|uncontrolled | Default to controlled | | resetOnSuccess | boolean | Clear the form on successful submission |

useFormContext()

Can be used in any component nested inside the Form component to access the form context.

📄 License

MIT — Made with ❤️ by Explita