Once you’ve built your multi-step form layout, you can export it as a HubSpot CMS module ready for deployment. This guide covers the complete export workflow.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/davidmenlop/HubSpot-Form-builder/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The export process generates five files packaged in a ZIP archive:- fields.json - Module field definitions and your layout configuration
- module.html - HubL template with multi-step form markup
- module.css - Styles for the form interface
- module.js - JavaScript for step navigation and validation
- meta.json - Module metadata for HubSpot
Generated Module Files
Let’s examine what each file contains:fields.json
This is the most important file - it contains your custom layout encoded as HubSpot module fields. Structure:- Default values: Your exact layout is encoded in the
defaultproperty - Field mapping: Each field maps to a HubSpot form property via
form_property - Field types: Automatically converted from HubSpot types (text, email, phone_number, etc.)
- Row structure:
field_grouprepresents rows, each containing 1-3 fields
fieldsJsonGenerator.ts:39-372.
module.html
The HubL template that renders your multi-step form. Key features:- Loops through
module.stepsto render each step - Generates progress indicator
- Renders fields in rows based on
field_groupstructure - Includes hidden HubSpot form for submission
- Step navigation buttons
moduleHtmlGenerator.ts.
module.css
Styles for the multi-step form UI. Includes:- Progress bar styles
- Step container layout
- Field row responsive grid (1-3 columns)
- Button styles
- Validation error states
- Mobile responsive breakpoints
moduleCssGenerator.ts.
module.js
JavaScript for form functionality. Features:- Step navigation (next/previous)
- Progress bar updates
- Field validation before advancing steps
- Form submission to HubSpot Forms API
- Error handling and display
moduleJsGenerator.ts.
meta.json
HubSpot module metadata. Structure:- label: Your HubSpot form name
- module_id: Unique identifier (generated via
crypto.randomUUID()) - host_template_types: Where module can be used
exportModule.ts:18-37.
Export Workflow
Follow these steps to export your module:Complete Your Layout
- All required fields are in the layout
- Steps are properly named
- Fields are organized into logical rows
- Layout has been previewed and tested
Click Generate Module
Wait for Generation
- Converts your layout to fields.json format
- Generates HTML, CSS, and JS files
- Creates meta.json with unique module ID
- Packages everything into a ZIP using JSZip
Uploading to HubSpot Design Manager
After downloading your module ZIP, upload it to HubSpot:Navigate to Design Manager
- Click Marketing → Files and Templates → Design Tools
- Or go directly to
https://app.hubspot.com/design-manager/{your-portal-id}
Navigate to Modules Folder
- Expand your design folder (e.g.,
@hubspot/design-folder) - Find or create a
modulesfolder - Click on it to select
Upload the ZIP
.zip file.Or drag and drop the ZIP into the Design Manager.Wait for Extraction
- Extracts the ZIP contents
- Creates a
.modulefolder - Registers the module
{form-name}.module appear in your modules folder.Using the Module in HubSpot
Once uploaded, you can add your module to pages:Edit a Page
Add Module to Page
Configure Module
- Steps section with your layout (tab labels, field groups)
- HubSpot Form selector to choose which form to connect
- Module ID and Class fields for customization
Select HubSpot Form
- Click the dropdown
- Select the same form you used in the Form Builder
- This connects the module fields to actual HubSpot form properties
Customize (Optional)
- Edit step names
- Reorder fields
- Add/remove field groups
- Customize button text
Testing the Module in HubSpot
After publishing, thoroughly test your form:Functionality Testing
Test Step Navigation
Test Step Navigation
Test Field Validation
Test Field Validation
- Leave a required field empty
- Try to advance to next step
- Verify error message appears
- Fill the field
- Verify you can now advance
- Test email field with invalid email
- Test phone field with invalid format
Test Form Submission
Test Form Submission
- Fill out all required fields
- Submit the form
- Verify success message appears
- Check HubSpot Contacts to confirm submission was recorded
- Verify all field values are correct in contact record
Test Responsive Behavior
Test Responsive Behavior
- Open page on desktop (1920px)
- Verify 2-3 field rows display side-by-side
- Resize to tablet (768px)
- Verify fields stack appropriately
- Open on mobile (375px)
- Verify single-column layout
- Test form submission on mobile
Browser Testing
Test in multiple browsers:- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Mobile Safari (iOS)
- Chrome Mobile (Android)
Troubleshooting Export Issues
Generate button does nothing
Generate button does nothing
Download button doesn't appear
Download button doesn't appear
ZIP file is corrupted
ZIP file is corrupted
- Try a different browser
- Check available disk space
- Disable browser extensions that might interfere with downloads
Fields.json has missing fields
Fields.json has missing fields
- Ensure all fields you want are in the canvas
- Fields in “Campos detectados” palette are NOT included in export
- Drag fields from palette to canvas before exporting
Module upload fails in HubSpot
Module upload fails in HubSpot
- Invalid JSON in fields.json or meta.json
- Missing required files
- Incorrect folder structure
- Extract ZIP locally to verify contents
- Validate JSON files at jsonlint.com
- Ensure folder name ends with
.module - Re-generate and re-download the module
Module shows in Design Manager but not in page editor
Module shows in Design Manager but not in page editor
- Check
meta.jsonhas"is_available_for_new_content": true - Verify
host_template_typesincludes"PAGE" - Clear HubSpot cache (Settings → Advanced)
Form doesn't submit
Form doesn't submit
- HubSpot form not selected in module settings
- Field
form_propertynames don’t match HubSpot form fields - JavaScript errors in module.js
- In page editor, select the HubSpot form in module settings
- Verify field property names match exactly (case-sensitive)
- Check browser console for JS errors
Module Regeneration
If you need to update your module after making layout changes:Make Your Changes
- Reorder fields
- Add/remove steps
- Rename steps
- Reorganize rows
Best Practices
Advanced: Manual Module Editing
After uploading to HubSpot, you can manually edit module files:Editing module.css
- Navigate to the module in Design Manager
- Click
module.css - Add custom styles:
- Click Publish changes
Editing module.html
- Click
module.html - Modify the HubL template
- Test in preview mode
- Publish changes
