Skip to content

Block Types ​

Blocks are the building units of every Templatical template. Each block represents a distinct piece of content -- a paragraph, an image, a button. Blocks can be placed directly in the template or inside sections for multi-column layouts. The editor renders them top-to-bottom in the order they appear.

Every block extends a common Block base with shared properties (id, type, styles, displayCondition, visibility), and each type adds its own specific properties.

To create blocks programmatically, see Programmatic Templates. For default property values and how to customize them, see Block & Template Defaults.

Choosing the right block ​

NeedBlockNotes
Headings, titlesTitleFixed-size headings (H1-H4) with block-level formatting
Body text, paragraphsParagraphRich text with inline formatting via TipTap
Photos, banners, logosImageOptional link wrapping, responsive width
Call-to-actionButtonBulletproof buttons that work in all email clients
Multi-column layoutSectionThe only block that holds other blocks
Visual separationDividerHorizontal line with style options
Vertical spacingSpacerEmpty space between blocks
Social linksSocial Icons17 platforms, 5 icon styles
Navigation linksMenuHorizontal link list with separators
Tabular dataTableData table with optional header styling
Video previewVideoClickable thumbnail (email clients don't support embedded video)
Countdown to a deadlineCountdownAnimated timer; rendering needs Templatical Cloud
Raw markupHTMLEscape hatch for custom code
Domain-specific contentCustomYour own block types with fields and Liquid templates

Title ​

A heading block with fixed size levels. Use titles for headings, section headers, and other prominent text.

PropertyTypeDescription
contentstringHTML content
level1 | 2 | 3 | 4Heading level (H1=36px, H2=28px, H3=22px, H4=18px)
colorstringText color
textAlign'left' | 'center' | 'right'Horizontal alignment
fontFamilystringFont family override

Paragraph ​

Body text rendered as HTML. The editor uses Tiptap for inline editing with formatting controls (bold, italic, links, alignment, font size, color, etc.). All formatting is applied inline -- there are no block-level formatting properties.

PropertyTypeDescription
contentstringHTML content

Image ​

Displays an image with optional link wrapping.

PropertyTypeDescription
srcstringImage URL
altstringAlt text
widthnumber | 'full'Display width in px, or 'full' for 100%
heightnumberDisplay height in px. Omit to derive it from the width and keep the aspect ratio
align'left' | 'center' | 'right'Horizontal alignment
borderRadiusBorderRadiusValueCorner radius in px, or { topLeft, topRight, bottomRight, bottomLeft } per corner. Omit or 0 for square corners
borderBorderValue{ top, right, bottom, left }, each { width, style, color }, drawn around the image. Width 0 leaves a side undrawn. Omit for no border
decorativebooleanHides the image from screen readers and sends an empty alt
linkUrlstringWraps image in a link
linkOpenInNewTabbooleanLink target behavior
placeholderUrlstringPlaceholder shown in the editor when src uses a merge tag

Button ​

A call-to-action button with customizable appearance.

PropertyTypeDescription
textstringButton label
urlstringLink URL
backgroundColorstringButton background color
textColorstringButton text color
borderRadiusBorderRadiusValueCorner radius in px, or one per corner
borderBorderValue{ top, right, bottom, left }, each { width, style, color }, drawn around the button (optional). For an outline button, set the background to the keyword "transparent" and set textColor too. A new button is #333333 with white text. Clearing the fill exports "transparent", because an omitted fill falls back to MJML's #414141
fontSizenumberFont size in px
buttonPaddingSpacingValueInner padding
fontFamilystringFont family override
openInNewTabbooleanLink target behavior
widthnumber | 'full'Fixed width in px, or 'full' for 100%. Omit to size to content.
align'left' | 'center' | 'right'Placement within the column. No visible effect when width is 'full'.

Divider ​

A horizontal line separator.

PropertyTypeDescription
lineStyle'solid' | 'dashed' | 'dotted'Line style
colorstringLine color
thicknessnumberLine thickness in px
widthnumber | 'full' | '<n>%'Line width: pixels, 'full' for the whole column, or a percentage of the column ('50%')

Spacer ​

Empty vertical space.

PropertyTypeDescription
heightnumberHeight in px

HTML ​

Injects raw HTML into the template. Use this for content that cannot be expressed with other block types.

PropertyTypeDescription
contentstringRaw HTML markup

Social Icons ​

A row of social media icons linking to platform profiles.

PropertyTypeDescription
iconsSocialIcon[]List of social icons
iconStyle'solid' | 'outlined' | 'rounded' | 'square' | 'circle'Visual style
iconSize'small' | 'medium' | 'large'Icon size
spacingnumberSpace between icons in px
align'left' | 'center' | 'right'Horizontal alignment

17 platforms are supported: Facebook, Twitter/X, Instagram, LinkedIn, YouTube, TikTok, Pinterest, Email, Website, WhatsApp, Telegram, Discord, Snapchat, Reddit, GitHub, Dribbble, and Behance.

Each SocialIcon has:

ts
interface SocialIcon {
  id: string;
  platform: SocialPlatform;
  url: string;
}

A horizontal navigation menu with text links.

PropertyTypeDescription
itemsMenuItemData[]Menu items
fontSizenumberFont size in px
fontFamilystringFont family override
colorstringText color
linkColorstring (optional)Link color
textAlign'left' | 'center' | 'right'Alignment
separatorstringCharacter between items
separatorColorstringSeparator color
spacingnumberSpace around separator

Each MenuItemData has:

ts
interface MenuItemData {
  id: string;
  text: string;
  url: string;
  openInNewTab: boolean;
  bold: boolean;
  underline: boolean;
  color?: string;
}

Table ​

A data table with optional header row styling.

PropertyTypeDescription
rowsTableRowData[]Table rows
hasHeaderRowbooleanStyle first row as header
headerBackgroundColorstring (optional)Header row background
borderColorstringBorder color
borderWidthnumberBorder width in px
cellPaddingnumberCell padding in px
fontSizenumberFont size in px
fontFamilystringFont family override
colorstringText color
textAlign'left' | 'center' | 'right'Cell text alignment

Video ​

Displays a video thumbnail that links to the video URL.

Email client note

Email clients do not support embedded video playback. The renderer outputs a clickable thumbnail image that links to the video URL. Always provide a good thumbnailUrl -- it's the only thing recipients see in their inbox.

PropertyTypeDescription
urlstringVideo URL (YouTube, Vimeo, etc.)
thumbnailUrlstringThumbnail image URL
altstringAlt text for thumbnail
widthnumber | 'full'Display width in px, or 'full' for 100%
heightnumberDisplay height in px. Omit to derive it from the width and keep the aspect ratio
align'left' | 'center' | 'right'Horizontal alignment
openInNewTabbooleanLink target behavior
placeholderUrlstringEditor-only placeholder

Countdown ​

A live countdown to a deadline, rendered as an animated GIF.

Rendering requires Templatical Cloud

An animated GIF has to be generated per recipient at send time, which a browser cannot do. The open-source renderer has no renderer for this block: it emits a templatical:unrenderable-block marker comment and logs a warning, so a send pipeline can detect and refuse it. See Blocks with no renderer. On a hosted backend that can render GIFs, the block renders normally.

PropertyTypeDescription
targetDatestringISO date/time the countdown runs to
timezonestringIANA timezone the target is interpreted in
showDays / showHours / showMinutes / showSecondsbooleanWhich units to display
labelDays / labelHours / labelMinutes / labelSecondsstringCaption under each unit
separator':' | '-' | ' 'Character between units
digitFontSizenumberDigit size in px
digitColorstringDigit colour
labelFontSizenumberCaption size in px
labelColorstringCaption colour
backgroundColorstringBlock background
fontFamilystring (optional)Font family override
expiredMessagestringShown once the target has passed
expiredImageUrlstringImage shown instead of the timer once expired
hideOnExpirybooleanHide the block entirely after the target passes

Section ​

A layout container that holds one or more columns. See Sections and Columns for full details.

PropertyTypeDescription
columnsColumnLayoutColumn layout preset
childrenBlock[][]Array of block arrays, one per column
stackOnMobilebooleanOmit or true: columns stack on mobile (MJML default). false: stay side by side (mj-group)
borderRadiusBorderRadiusValueCorner radius in px, or one per corner (optional; omit or 0 for square corners)
borderBorderValue{ top, right, bottom, left }, each { width, style, color }, drawn around the section box (optional; omit for no border)
wrapperSectionWrapperOptional outer frame — { backgroundColor?, padding?, borderRadius? } — rendered as an mj-wrapper band around the section. An embedder-owned card around the authored sections is a layout overlay.

Email client note: borders and corners in Outlook

  • Outlook on Windows ignores border-radius, including the four-value (per-corner) form.
  • Dashed and dotted borders compile, and Outlook's rendering engine often paints them solid.
  • An image border is drawn on the <img>, and Outlook often drops it. Section and button borders sit on the <td>, which is the durable place for a border.

Custom ​

A user-defined block type powered by field definitions and a Liquid template. See Custom Blocks for full details.

PropertyTypeDescription
customTypestringUnique identifier for the custom block type
fieldValuesRecord<string, unknown>Current values for defined fields
renderedHtmlstringCached rendered output
dataSourceFetchedbooleanWhether the data source has been fetched