@hatchd/sanity-plugin-form-builder
v1.1.0
Published
A form builder plugin for Sanity Studio
Downloads
397
Readme
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
- 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.