@hatchd/sanity-plugin-form-builder
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Form Builder - A form builder plugin for Sanity

With the plugin, you can create forms in Sanity while remaining frontend-agnostic. Utilize GROQ to query the forms and showcase them on the frontend with your favorite frameworks and UI kits.

Currently the fields supported are:

  • Text
  • Textarea
  • Dropdown
  • Email
  • Telephone
  • Hidden
  • Number
  • Date
  • Time
  • Checkbox
  • Checkboxes group
  • Radio buttons
  • Form Group, a group of various inputs

Each field contains a label among other options such as being required or set a default value.

Installation

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

// Yarn
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()],
})

Schema

Form

{
  formTitle: 'string',
  description: 'string',
  emailTo: 'string',
  emailSubject: 'string',
  customFormFields: 'array' // Where the fields you have added
}

License

MIT © Hatchd Team

Note

This is a Sanity Studio v3 plugin, the plugin will not work versions 2 and lower.

Package Sidebar

Install

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

Weekly Downloads

266

Version

1.1.0

License

MIT

Unpacked Size

147 kB

Total Files

29

Last publish

Collaborators

  • hatchd-devteam
  • eoinie
  • leighkendell
  • edhatchd