Build emails from a small set of cross-client-tested components. Author them visually in the template editor, or in code using the constrained TSX dialect below — the same components render identically in the editor preview and in the email your recipients receive.
A small set of cross-client-tested components for building email.
The Unitpost component library is a constrained set of building blocks for email — layout, typography, media, and interactive elements — designed so the same document renders pixel-for-pixel in every inbox, Outlook included. Under the hood each component compiles to the table-based, inline-styled HTML that email clients actually respect, so you never touch archaic markup yourself.
Everything on this page is powered by the `@unitpost/email` package — the exact renderer the send engine uses. Author your email visually in the template editor, or in code using the constrained TSX dialect below; both produce the same document, and the preview you see here is the email your recipients get.
Not React Email
The dialect looks like React, but it's a small, fixed vocabulary (the components below) rather than arbitrary JSX. That constraint is what lets the visual editor and the code editor stay perfectly in sync and guarantees cross-client output.
Insert dynamic data anywhere with `{{variable}}` — it's substituted at send time from the values you pass to the API, a contact's fields, or a campaign default.
Add the package and render your first email in a few minutes.
You don't need to install anything to use the components in the in-app editor — open any template, switch to Code mode, and start composing. To render or send emails from your own codebase, add the package below.
Compose a document from the components. In the editor's Code mode you write just the body markup; in your own code you build the same document and hand it to the renderer.
import { parseTsx, renderToHtml, resolveVariables } from "@unitpost/email";
// The same constrained TSX you'd write in the editor's Code mode.
const doc = parseTsx(`
<Section padding-y={32}>
<Heading level={1}>Welcome, {{first_name}}</Heading>
<Text>Thanks for joining. Confirm your email to get started.</Text>
<Button href="https://example.com/verify?token={{token}}">
Verify email
</Button>
</Section>
`);
// Fill {{variables}} and render to email-safe HTML.
const { values } = resolveVariables(doc, {
first_name: "Ada",
token: "abc123",
});
const html = renderToHtml(doc, values);
Prefer the visual builder?
You never have to write code — the template editor builds the identical document with drag-and-drop blocks, and you can flip to Code mode any time to see (or edit) the TSX.
Save the template in your workspace and reference it when you send, or pass the rendered HTML directly. Both go through the same delivery pipeline — see the API reference for the full send surface.
Explore the components below — start with Section and Row for layout, then Heading, Text, and Button for content. Every block also accepts the common props.
Components
Every building block, with a live preview and its props.
Inner content may include inline HTML for formatting: <strong>, <em>, <u>, <a href>, and <span style> (color / background-color). These round-trip through the visual editor.
<Text>Hi {{first_name}}, thanks for signing up.</Text>
Prop
Type
Default
Description
align
enumleft | center | right
left
Text alignment.
color
color
—
Text color.
font-size
number
16
Font size (px).
font-family
string
—
Override the document font for this block.
<Divider>
A thin horizontal rule to separate sections.
<Divider />
Prop
Type
Default
Description
color
color
#e4e4e7
Line color.
<Spacer>
Margins are unreliable across clients, so a Spacer renders as an explicit fixed-height cell.
<Spacer height={24} />
Prop
Type
Default
Description
heightrequired
number
24
Gap height (px).
<Markdown>
Author rich copy in Markdown — compiled to email-safe HTML.
<Markdown>**Welcome!** Here's _what's new_ this week. [See all](https://example.com)</Markdown>
Prop
Type
Default
Description
align
enumleft | center | right
left
Alignment.
color
color
—
Base text color.
font-size
number
16
Base font size (px).
<Code>
A monospace code block — handy for API keys and snippets.