--- title: "Form Builder Plugin" aliases: [form-builder, plugin-form-builder, payloadcms-forms] tags: [payloadcms, plugin, forms, email, payments, uploads] sources: [raw/plugins__form-builder.md] created: 2026-05-15 updated: 2026-05-15 --- ## Overview `@payloadcms/plugin-form-builder` lets admins build and manage forms dynamically from the Admin Panel — no hard-coding new forms in the codebase. The front-end maps over the schema and renders its own UI components. All submissions are stored in the DB; confirmations can be on-screen messages or redirects; dynamic emails are sent on submission. Replaces third-party services (HubSpot, Mailchimp) with first-party tooling. ## Installation ```bash pnpm add @payloadcms/plugin-form-builder ``` ```ts import { formBuilderPlugin } from '@payloadcms/plugin-form-builder' export default buildConfig({ plugins: [formBuilderPlugin({ /* options */ })], }) ``` ## Key Options | Option | Type | Purpose | |--------|------|---------| | `fields` | object | Enable/disable/override individual field types | | `redirectRelationships` | string[] | Collection slugs available as redirect targets | | `beforeEmail` | hook | Transform emails just before they are sent | | `defaultToEmail` | string | Fallback recipient if form config omits `to` | | `formOverrides` | CollectionConfig | Override the `forms` collection (slug, access, fields) | | `formSubmissionOverrides` | CollectionConfig | Override the `form-submissions` collection | | `handlePayment` | hook | Process payment on submission (use with `payment` field) | | `uploadCollections` | string[] | Required when `upload` field is enabled | ### Security Warning The `forms` collection is **publicly readable by default** — including the `emails` field. Override `formOverrides.access` to restrict it, especially if you have frontend users. ```ts formBuilderPlugin({ formOverrides: { access: { read: ({ req: { user } }) => !!user, }, fields: ({ defaultFields }) => [...defaultFields, { name: 'custom', type: 'text' }], }, }) ``` ## Available Field Types | Field | Maps to | Notes | |-------|---------|-------| | `text` | `` | Simple string | | `textarea` | `