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

@hatchd/sanity-plugin-form-builder

v1.3.0

Published

A form builder plugin for Sanity Studio

Readme

Form Builder - A form builder plugin for Sanity

Create and manage forms in Sanity Studio while remaining frontend-agnostic. Use GROQ to query your forms and render them on the frontend with your preferred framework and UI kit.

This is a Sanity Studio v3/v4 plugin.

Supported Fields

  • Text, Email, Telephone, Number, URL, Hidden, Date, Time
  • Textarea
  • Select (dropdown)
  • Checkbox
  • Checkbox group
  • Radio button group
  • Form group (a labelled container for grouping fields)

Each field includes a label, optional hint/error messages, and a required toggle. Select, checkbox group, and radio button group support default values and enforce unique option values.

Installation

npm install @hatchd/sanity-plugin-form-builder

or

yarn add @hatchd/sanity-plugin-form-builder

Usage

Add it as a plugin in sanity.config.ts (or .js):

import {defineConfig} from 'sanity'
import {FormBuilderPlugin} from '@hatchd/sanity-plugin-form-builder'

export default defineConfig({
  //...
  plugins: [FormBuilderPlugin({})],
})

This registers all form schema types. You can then create baseForm documents in the Studio and reference them from your page content using the formModule object type.

Plugin Options

Customise which schemas are registered and override individual field schemas:

FormBuilderPlugin({
  // Override specific field schemas by logical name
  override: {
    input: {
      disableFields: ['fieldPlaceholder'],
      addFields: [
        /* additional Sanity field definitions */
      ],
    },
    textarea: {
      /* ... */
    },
    // Also: select, checkbox, checkboxGroup, radioButtonGroup
  },

  // Include only specific schemas (allowlist)
  schemas: ['formDocument', 'formFieldType', 'formTextareaType'],

  // Or exclude specific schemas (denylist)
  disableSchemas: ['checkboxGroup', 'radioButtonGroup'],
})

schemas and disableSchemas are mutually exclusive — if schemas is provided, only those are registered. If disableSchemas is provided, everything except those is registered.

Logical Names for disableSchemas

| Logical Name | Schema Type | | ------------------ | ---------------------- | | input | formFieldType | | textarea | formTextareaType | | select | formSelectType | | checkbox | formCheckboxType | | checkboxGroup | formCheckboxGroup | | radioButtonGroup | formRadioButtonGroup |

Schema

baseForm (Document)

The main form definition document.

{
  formTitle: string        // Required
  description?: string
  emailTo: string[]        // Array of email addresses (validated)
  emailSubject?: string
  customFormFields: array  // The form fields added by the editor
}

formEntry (Document)

Read-only submission capture. Created by your frontend when a form is submitted.

{
  formTitle?: string
  formRef?: Reference      // Reference to the baseForm
  fields?: Array<{
    label?: string
    value?: string
  }>
}

TypeScript Support

All form types are exported for use in your frontend:

import type {
  BaseForm,
  FormEntry,
  FormCustomField,
  FormField,
  FormTextarea,
  FormSelect,
  FormCheckbox,
  FormCheckboxGroup,
  FormRadioButtonGroup,
  FormGroup,
  FormModule,
} from '@hatchd/sanity-plugin-form-builder'

The plugin also exports FormBuilderEnums for referencing document and field type names without a Zod dependency:

import {FormBuilderEnums} from '@hatchd/sanity-plugin-form-builder'

FormBuilderEnums.documents.baseForm // 'baseForm'
FormBuilderEnums.fields.formField // 'formField'

License

MIT © Hatchd Team