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

@ideative/chakra-zod-forms

v0.2.0

Published

Chakra Zod Form - A library for creating forms with Zod and Chakra UI

Readme

@ideative/chakra-zod-forms

Type-safe form helpers for React Hook Form + Zod + Chakra UI.

Documentation

What this library provides

  • createZodForm(schema) factory with typed Form, Field, Fieldset, FormDialog, and async createFormDialog
  • ManagedField / ManagedFieldset wrappers to reduce form boilerplate
  • AutoField that picks input renderers from Zod field types
  • Extensible auto-field type manager and matcher utilities
  • Sub-form helpers for nested object sections

Installation

pnpm add @ideative/chakra-zod-forms

Peer dependencies:

pnpm add react @chakra-ui/react react-icons

Direct runtime dependencies used by this package:

  • react-hook-form
  • @hookform/resolvers
  • zod

Quick start

import { Button } from "@chakra-ui/react";
import { z } from "zod";
import { createZodForm } from "@ideative/chakra-zod-forms";

const schema = z.object({
  firstName: z.string().min(1),
  age: z.number().min(18),
  isActive: z.boolean().default(true),
});

type FormValue = z.infer<typeof schema>;

const { Form, Field } = createZodForm<FormValue>(schema);

export function UserForm() {
  return (
    <Form
      defaultValue={{ firstName: "", age: 18, isActive: true }}
      onSubmit={(value) => {
        console.log(value);
      }}
    >
      <Field name="firstName" label="First name" autofield />
      <Field name="age" label="Age" autofield />
      <Field name="isActive" label="Active" autofield />

      <Button type="submit">Save</Button>
    </Form>
  );
}

Async form dialog

createZodForm also provides createFormDialog() for promise-based dialogs built on createAsyncDialog.

const { createFormDialog, Field } = createZodForm(schema)
const [openUserForm, UserFormModal] = createFormDialog(
  () => (
    <>
      <Field name="firstName" label="First name" autofield />
      <Field name="age" label="Age" autofield />
      <Field name="isActive" label="Active" autofield />
    </>
  ),
  { submitText: 'Create' }
)

function Page() {
  return (
    <>
      <button
        type="button"
        onClick={async () => {
          const value = await openUserForm({
            title: 'Create user',
            defaultValue: { firstName: '', age: 18, isActive: true }
          })
          // value is FormValue | undefined
        }}>
        Open Form Dialog
      </button>

      <UserFormModal />
    </>
  )
}

AutoField customization

Register a custom renderer for specific Zod shapes:

import {
  AutoFieldTypeManagerProvider,
  createAutoFieldTypeManagerWithDefaults,
  matchesObjectShape,
  isZodNumber,
  isZodString
} from '@ideative/chakra-zod-forms'

const isMoneyObject = matchesObjectShape({
  currency: isZodString,
  value: isZodNumber,
})

const manager = createAutoFieldTypeManagerWithDefaults([
  {
    id: 'money',
    match: isMoneyObject,
    component: MoneyFieldRenderer,
    priority: 10,
  },
])

<AutoFieldTypeManagerProvider manager={manager}>
  <MyForm />
</AutoFieldTypeManagerProvider>

Exports

Primary exports from src/index.ts:

  • createZodForm
  • createAsyncDialog, AsyncDialogController
  • ManagedField, ManagedFieldset
  • createSubForm, FormPartProvider, FormPartManagedField
  • AutoField and all auto-field/* utilities
  • UI helpers: Field, ToggleTip
  • Zod type utilities

Development

pnpm install
pnpm test:run
pnpm build
pnpm storybook

Build static Storybook docs:

pnpm storybook:build

Documentation

Storybook is the documentation surface for this project. Docs: https://ideativedigital.github.io/chakra-zod-forms/?path=/docs/docs-api-reference--docs Deployment workflow: .github/workflows/deploy-storybook.yml.

License

MIT