Skip to main content

Content types

Every content block in a column carries the Content envelopeid, type, and values. The type discriminates which shape values takes. This page is the per-type reference.

Per-mode variants

Content blocks render in four display modes — email, web, document, popup. Each mode exposes a subset of values fields (e.g. email-only border-collapse handling, web-only hover states). The embedded editor surfaces only the options that apply to the active mode; the API endpoints expect the union. If you're hand-crafting designs, pass displayMode to /v3/templates/validate so per-mode rules apply.

Built-in types

typeWhat it is
textA rich-text paragraph. values.text holds inline HTML (<a>, <strong>, <em>, spans for color/size). Merge tags supported via {{ tag }}.
imageAn image with optional link, alt text, alignment, and per-device sizing.
buttonA call-to-action button — label, link, color, border, padding, alignment.
headingA <h1><h6> heading. values.headingType controls the level; values.text holds the inline HTML.
dividerA horizontal rule with color, thickness, and width controls.
htmlA raw-HTML escape hatch. Use sparingly — the editor renders the string verbatim, no sanitization.
videoA linked video thumbnail with an overlaid play icon — emails can't embed real video players, so this is the conventional fallback.
socialA row of social-network icons with per-network URLs and a shared style.
menuA horizontal navigation menu — list of { label, url }, shared style.
timerA countdown to a target timestamp. Renders a server-side image so it works in email clients without JS.

Custom tools

Embedders can register their own content types via unlayer.registerTool(...). Custom blocks carry an extra slug discriminator:

{
"type": "custom",
"slug": "my_pricing_block",
"values": {
/* shape defined by the embedder */
}
}

The values shape is whatever your tool definition declares — Unlayer validates the envelope but treats values as opaque. See Custom Tools for the registration API.

Shared value fields

All content values share a common envelope of styling and layout fields — exact subset varies by type and display mode:

FieldTypeNotes
containerPaddingstringCSS-style padding shorthand, e.g. "10px 0px".
hideDesktopbooleanHide on desktop breakpoint.
hideMobilebooleanHide on mobile breakpoint.
_meta{ htmlID: string, htmlClassNames: string }Stable identifiers for CSS targeting. Editor-managed.
displayConditionobject | nullMerge-tag-based show/hide condition; null = always show.
anchorstringOptional fragment id for in-page anchor links.

For the canonical per-type schema, validate a payload against /v3/templates/validate — the response will tell you exactly which fields are required and which are extras.

  • Design object — the root that contains everything.
  • Block object — the rows / columns that hold these content items.
  • Custom Tools — register your own content types.
  • Validate — verify a design against the canonical schema.