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

formforges

v0.1.2

Published

Schema-first form infrastructure for React — single package

Readme

formforges

Schema-first form infrastructure for React.
Define your form in a plain config object. FormForge handles UI, validation, layout, accessibility, and themes — automatically.

npm license TypeScript

Website & Docs →


Install

npm install formforges
# or
pnpm add formforges
# or
yarn add formforges

Quick Start

import { FormForge } from 'formforges'

const schema = {
  name:    { type: 'text',     label: 'Full Name', required: true },
  email:   { type: 'email',    label: 'Email',     required: true },
  role:    { type: 'select',   label: 'Role',
    options: [
      { value: 'dev',      label: 'Developer' },
      { value: 'designer', label: 'Designer'  },
    ],
  },
  bio:     { type: 'textarea', label: 'Bio' },
}

export function MyForm() {
  return (
    <FormForge
      schema={schema}
      theme="modern"
      onSubmit={async (values) => {
        await fetch('/api/submit', { method: 'POST', body: JSON.stringify(values) })
      }}
    />
  )
}

That's it — fully rendered, validated, accessible, responsive form.


Features

| | Feature | |---|---| | ⚡ | Zero config UI — labels, inputs, errors, submit — all automatic | | 📐 | Smart layout — 2-column grid, collapses to 1 column on mobile | | ✅ | Validation — built-in rules, async validators, Zod adapter | | 🎨 | 3 Themesmodern, minimal, enterprise — fully token-based | | ♿ | Accessibilityaria-required, aria-invalid, role="alert", focus management | | 🔌 | Headless modeuseFormForge, useField, createForm() | | 📦 | Tiny — tree-shakeable ESM, field-level subscriptions | | 🔷 | TypeScript-first — strict types, full schema inference |


Field Types

const schema = {
  // Text
  name:     { type: 'text' },
  email:    { type: 'email' },
  password: { type: 'password' },
  age:      { type: 'number', min: 18, max: 99 },
  bio:      { type: 'textarea' },
  dob:      { type: 'date' },

  // Choice
  agree:   { type: 'checkbox', label: 'I agree' },
  role:    { type: 'radio',  options: [{ value: 'admin', label: 'Admin' }] },
  country: { type: 'select', options: [{ value: 'us',    label: 'USA'   }] },

  // Conditional
  state: { type: 'text', showIf: (values) => values.country === 'us' },

  // Complex
  links:   { type: 'array',  items:  { url: { type: 'text' } } },
  address: { type: 'object', fields: { street: { type: 'text' }, city: { type: 'text' } } },
}

Themes

<FormForge schema={schema} theme="modern"     />  {/* Indigo, rounded, subtle shadows */}
<FormForge schema={schema} theme="minimal"    />  {/* Black, sharp, no shadows        */}
<FormForge schema={schema} theme="enterprise" />  {/* Teal, professional, dense        */}

Custom theme:

import { modernTokens } from 'formforges'

const myTheme = {
  ...modernTokens,
  colors: { ...modernTokens.colors, primary: '#f59e0b' },
}

Validation

import { rules } from 'formforges'

const schema = {
  email:    { type: 'email',    validate: rules.email() },
  username: { type: 'text',     validate: rules.minLength(3) },
  password: { type: 'password', validate: [
    rules.required(),
    rules.minLength(8),
    rules.pattern(/[A-Z]/, 'Must contain uppercase'),
  ]},
  // Async
  handle: {
    type: 'text',
    validate: async (value) => {
      const { taken } = await fetch(`/api/check?q=${value}`).then(r => r.json())
      return taken ? 'Already taken' : null
    },
  },
}

Zod adapter:

import { zodValidator } from 'formforges'
import { z } from 'zod'

validate: zodValidator(z.string().email())

Headless Mode

import { useFormForge, useField } from 'formforges'

// Full form control
function MyForm() {
  const { values, errors, isSubmitting, submit, reset } = useFormForge({
    schema,
    onSubmit: async (values) => { /* ... */ },
  })

  return (
    <form>
      {/* your own UI */}
      <button onClick={submit} disabled={isSubmitting}>Save</button>
      <button onClick={reset} type="button">Reset</button>
    </form>
  )
}

// Custom field
function StarRating({ fieldKey }: { fieldKey: string }) {
  const { value, error, touched, onChange } = useField(fieldKey)

  return (
    <div>
      {[1, 2, 3, 4, 5].map((star) => (
        <button key={star} type="button" onClick={() => onChange(star)}
                style={{ color: Number(value) >= star ? 'gold' : 'gray' }}>★</button>
      ))}
      {touched && error && <p>{error}</p>}
    </div>
  )
}

Packages

formforges includes everything. Individual packages are also available:

| Package | Description | |---|---| | formforges | All-in-one (recommended) | | @formforges/react | React renderer + hooks | | @formforges/core | Framework-agnostic engine | | @formforges/validator | Validation rules + Zod | | @formforges/themes | Token-based themes | | @formforges/layout-engine | Auto responsive grid | | @formforges/accessibility | ARIA + focus + keyboard |


Links


License

MIT © 2025 FormForge