Skip to main content
Last modified: August 22, 2025
HubSpot forms allow you to capture information from website visitors, which you can then access throughout HubSpot. You can share links to forms directly with users, submit form data via the API, and embed them on your website pages using the CMS. Below, find reference documentation for forms, including form embed configuration options, internationalization and validation error messages, and form events.
Please note:
  • This article covers additional functionality you can use for new forms created through the updated forms editor. If you need to consult the corresponding functionality for legacy forms, check out this article instead.
  • If you require a more complex use-case for your form, like sending custom form submission data to HubSpot, you should review the v3 forms REST API documentation.

Global form events

Global form events allow you to extend the functionality of your form and define custom behavior for specific events triggered by your form (e.g., display a custom success message when a user submits a form). Learn more about using global form events for forms created in the updated forms editor in this article.

Define custom styling for embedded forms using CSS

You can define CSS variables to override the default styling for your embedded forms. This allows you to apply granular styling to specific elements of your forms, as well as define global styling rules to maintain consistency across all embedded forms.
:root {
  --hsf-global__font-family: 'impact';
  --hsf-global__font-size: 18px;
  --hsf-global__color: #fff;
  --hsf-background__background-color: #000;
}
The CSS variables you can override are listed in the tables below. The global styles will override top-level styling across all your embedded forms. You can also target individual elements of your forms such as a form element row, submit buttons, or form headings.

Global

VariableDescription
--hsf-global__font-familySets the font family for all elements
--hsf-global__font-sizeSets the font size for all elements
--hsf-global__colorSets the default text color for all elements
--hsf-global-error__colorSets the color for errors

Row

VariableDescription
--hsf-row__horizontal-spacingSets the horizontal spacing between rows
--hsf-row__vertical-spacingSets the vertical spacing between rows
--hsf-module__vertical-spacingSets the vertical spacing between modules

Button

VariableDescription
--hsf-button__font-familySets font family of all buttons
--hsf-button__font-sizeSets font size of all buttons
--hsf-button__colorSets text color of all buttons
--hsf-button__background-colorSet background color of all buttons
--hsf-button__background-imageSet background image of all buttons
--hsf-button__border-radiusSets border radius of all buttons
--hsf-button__paddingSets the padding of all buttons
--hsf-button__box-shadowSets the box shadow of all buttons

Rich Text

VariableDescription
--hsf-richtext__font-familySets the font family for rich text elements
--hsf-richtext__font-sizeSets the font size for rich text elements
--hsf-richtext__colorSets the text color for text elements

Heading

VariableDescription
--hsf-heading__font-familySets the font family for the form’s headings
--hsf-heading__colorSets the text color for form’s headings
--hsf-heading__text-shadowSets the text shadow for form’s headings

Background

VariableDescription
--hsf-background__background-colorSets the background color of the form
--hsf-background__background-imageSet the background image of the form
--hsf-background__background-sizeSet the background size
--hsf-background__background-positionSet the background position
--hsf-background__background-repeatSet the background repeat behavior
--hsf-background__border-styleSets the border style of the form
--hsf-background__border-colorSets the border color of the form
--hsf-background__border-radiusSets the border radius of the form
--hsf-background__border-widthSets the border width of the form
--hsf-background__paddingSets the padding of the form

Progress Bar

VariableDescription
--hsf-progressbar-text__font-familySets the font family for the progress bar text
--hsf-progressbar-text__font-sizeSets the font size for the progress bar text
--hsf-progressbar-text__colorSets the color for the progress bar text
--hsf-progressbar-progressLine__background-colorSets the background color of the progress line
--hsf-progressbar-progressLine__background-imageSets the background image of the progress line
--hsf-progressbar-progressLine__border-colorSets the border color of the progress line
--hsf-progressbar-progressLine__border-styleSets the border style of the progress line
--hsf-progressbar-progressLine__border-widthSets the border width of the progress line
--hsf-progressbar-trackLine__background-colorSets the background color of the track line

Error Alert

VariableDescription
--hsf-erroralert__font-familySets the font family for error alerts
--hsf-erroralert__font-sizeSets the font size for error alerts
--hsf-erroralert__colorSets the text color for error alerts

Info Alert

VariableDescription
--hsf-infoalert__font-familySets the font family for info alerts
--hsf-infoalert__font-sizeSets the font size for info alerts
--hsf-infoalert__colorSets the text color for info alerts

Field Input

VariableDescription
--hsf-field-label__font-familySets the font family of the field label
--hsf-field-label__font-sizeSets the font size of the field label
--hsf-field-label__colorSets the text color of the field label
--hsf-field-label-requiredindicator__colorSets the color of the required indicator for the field label
--hsf-field-description__font-familySets the font family of the field description
--hsf-field-description__colorSets the text color of the field description
--hsf-field-footer__font-familySets the font family of the field footer
--hsf-field-footer__colorSets the text color of the field footer
--hsf-field-input__font-familySets the font family of the field input
--hsf-field-input__colorSets the text color of the field input
--hsf-field-input__background-colorSets the background color of the field input
--hsf-field-input__placeholder-colorSets the placeholder color of the field input
--hsf-field-input__border-colorSets the border color of the field input
--hsf-field-input__border-widthSets the border width of the field input
--hsf-field-input__border-styleSets the border style of the field input
--hsf-field-input__border-radiusSets the border radius of the field input
--hsf-field-input__paddingSets the padding of the field input

Field Textarea

VariableDescription
--hsf-field-textarea__font-familySets the font family for the textarea
--hsf-field-textarea__colorSets the text color for the textarea
--hsf-field-textarea__background-colorSets the background color for the textarea
--hsf-field-textarea__placeholder-colorSets the color for the placeholder text in the textarea
--hsf-field-textarea__border-colorSets the border color for the textarea
--hsf-field-textarea__border-widthSets the border width for the textarea
--hsf-field-textarea__border-styleSets the border style for the textarea
--hsf-field-textarea__border-radiusSets the border-radius for the textarea
--hsf-field-textarea__paddingSets the padding for the textarea

Field Checkbox

VariableDescription
--hsf-field-checkbox__paddingSets the padding within form checkboxes
--hsf-field-checkbox__background-colorSets the background color of the checkboxes
--hsf-field-checkbox__colorSets the text color of the checkboxes
--hsf-field-checkbox__border-colorSets the color of the checkbox’s border
--hsf-field-checkbox__border-widthSets the width of the checkbox’s border
--hsf-field-checkbox__border-styleSets the style of the checkbox’s border

Field Radio

VariableDescription
--hsf-field-radio__paddingSets the padding for radio button
--hsf-field-radio__background-colorSets the background color for radio button
--hsf-field-radio__colorSets the text color of radio button
--hsf-field-radio__border-colorSets the border color for radio button
--hsf-field-radio__border-widthSets the border width for radio button
--hsf-field-radio__border-styleSets the border style for radio button