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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@chemical-x/forms

v0.4.1

Published

A fully type-safe, schema-driven form library that gives you superpowers. Chemical X included.

Readme

Chemical X Forms

npm version npm downloads License Node.js Test Suite Nuxt

A fully type-safe, schema-driven form library that gives you superpowers.Comes with a minimal composition API that prioritizes developer experience and form correctness. 🚧 this library is not production ready yet.

🏔️ Features

  • Compact API – Minimal yet expressive API surface with core functions like useForm, register, and handleSubmit to reduce boilerplate.
  • Abstract Schema Support – Integrates with validation libraries like Zod for type-safe schemas and automatic validation.
  • v-register Directive – One SSR-safe directive that automatically tracks everything.
  • Full State Tracking – Automatically tracks field states (value, touched, dirty status, validation errors, etc).
  • TypeScript Friendly – Fully type-safe, with advanced form type inference from your schema.

🪩 Installation

Install with Nuxi:

npx nuxi module add @chemical-x/forms

That's it! You can now use Chemical X Forms in your Nuxt app ✨

Install manually:

# Using npm
npm install @chemical-x/forms

Then add the module to your nuxt.config.ts:

export default defineNuxtConfig({
  modules: ["@chemical-x/forms"],
});

🪄 Usage

Basic Example

<script setup lang="ts">
import { z } from "zod";

// Define your schema
const schema = z.object({ planet: z.string() });

// Create your form
const { getFieldState, register, key } = useForm({ schema });

// Get the state of the 'planet' field
const planetState = getFieldState("planet");
</script>

<template>
  <div>
    <h1>Planet Form</h1>

    <input
      v-register="register('planet')"
      placeholder="Enter your favorite planet"
    />

    <p>Planet field State:</p>
    <pre>{{ JSON.stringify(planetState, null, 2) }}</pre>
    <hr />
  </div>
</template>

Core API Functions

note: detailed documentation coming soon

useForm(options?) – Initializes form state. Abstract schema required.

v-register – Custom, SSR-safe directive for registering components with Chemical X

register(name: string) – Binds a field to form state.

handleSubmit(onSubmit, onError?) – Handles submission with validation.

getValue(name: string) – Retrieves a field value.

setValue(name: string, value: any) – Updates a field programmatically.

getFieldState(name: string) – Returns field state (value, touched, errors, etc.).

🥇 Advanced Features

  • Fully SSR Safe – Fully Nuxt 3-compatible with hydration-safe bindings.

  • Validation Handling – Displays schema validation errors automatically.

  • Performance Optimizations – Efficient reactive updates for optimal performance.

🪪 License

@chemical-x/forms is released under the MIT License. See the LICENSE file for details.