Title AddOn
Overview
The Title AddOn (type: heading) allows you to insert heading elements (H1-H6) with custom styling. This is perfect for providing pre-formatted headlines, section titles, or branded heading styles to users.
Prerequisites
Before implementing a Title AddOn in your code, you must first create the addon in the Beefree SDK Developer Console:
Log into the Developer Console and navigate to your application
Create a new Custom AddOn and select "Title" as the type
Configure the addon with a unique handle (e.g.,
my-title-addon)Choose your implementation method (Content Dialog or External iframe)
Save the addon configuration
Content Object Schema
Required Structure
The Title AddOn uses a unique naming convention—note that the type is 'heading' (not 'title'). The schema requires a title property specifying the heading level ('h1' through 'h6') and a text property containing the heading content. Optional styling properties like align, size, bold, and color allow you to pre-style headings for brand consistency while users can further customize after insertion.
Important: The type is 'heading', not 'title'
{
type: 'heading', // Note: 'heading', not 'title'
value: {
title: string, // Required: 'h1', 'h2', 'h3', 'h4', 'h5', or 'h6'
text: string, // Required: Heading text
align: string, // Optional: 'left', 'center', 'right'
size: number, // Optional: Font size in pixels
bold: boolean,
color: string, // Optional: Hex color
linkColor: string // Optional: Hex color for links
}
}Basic Example
This minimal example demonstrates the simplest heading insertion with just the required properties. The title: 'h2' specifies it's a level-2 heading (semantically appropriate for major section headers), while text contains the actual heading content. This basic structure is perfect for straightforward heading needs where styling can be applied later.
Styled Example
This comprehensive example shows a fully styled heading with all common properties configured. By pre-setting the heading level, alignment, size, emphasis, and color, you ensure consistent brand styling across all headings without requiring users to manually format each one. This pattern is particularly useful for maintaining visual standards and speeding up content creation in email templates.
Content Dialog Implementation
Basic Handler
The Content Dialog method enables programmatic heading insertion through a JavaScript handler. When users drag your title addon onto the stage, this handler is immediately invoked and resolves with a predefined heading. This pattern works perfectly for static headings or branded heading styles that don't require user input, providing instant insertion of consistently formatted headers.
Pattern: Heading Level Selector
This pattern demonstrates creating a heading library with size-appropriate styling for each heading level. By mapping heading levels to appropriate font sizes, you maintain proper visual hierarchy (H1 largest, H6 smallest) while providing users with semantic heading options. This approach is ideal for template systems where consistent typographic hierarchy is important for both design and accessibility.
Pattern: With User Input
This advanced pattern shows how to let users provide heading text and select formatting options before insertion. By opening a custom interface, users can type their heading, choose the semantic level, set alignment, and configure other properties. The handler waits for user confirmation, then resolves with the customized heading. This provides maximum flexibility while maintaining proper heading structure and semantic HTML.
Iframe Implementation
Conceptual Flow
The Iframe method provides complete UI flexibility by loading your custom web application inside the Beefree editor. Your iframe communicates with Beefree through postMessage events, following a specific protocol. This approach is ideal for rich heading configuration interfaces, heading template libraries, or any scenario where you need full control over how users create and format heading content before inserting it into the email.
Required postMessage Communication
Your iframe must implement the standard postMessage protocol to integrate with Beefree. First, notify Beefree when your iframe is loaded and specify dialog dimensions. Listen for the "init" message to receive editor context. When the user finishes configuring their heading, send "onSave" with your heading object. If the user cancels, send "onCancel" to close without inserting. This bidirectional communication ensures seamless integration between your custom heading editor and Beefree.
1. Send "loaded" when your iframe is ready:
2. Listen for "init" message from Beefree:
3. Send "onSave" with heading data:
4. Send "onCancel" if user cancels:
Simple Iframe Example
This complete HTML example demonstrates a functional heading configuration interface. It includes the full postMessage protocol implementation, inputs for heading text and level selection, alignment options, and proper save/cancel handling. The interface automatically adjusts preview text size based on the selected heading level. You can expand this basic example with live preview, font selection, color pickers, or heading template galleries for more sophisticated heading creation.
Heading Levels
Choose the appropriate semantic level:
H1 - Main page/email title (use sparingly, typically once)
H2 - Major section headings
H3 - Subsection headings
H4-H6 - Further nested headings
Proper heading hierarchy improves accessibility and SEO.
Last updated
Was this helpful?

