elements
React components for transactional emails, landing pages, invoices and PDFs: email-safe HTML, responsive web HTML, and print-ready PDF HTML from one component t
What is elements?
React components for transactional emails, landing pages, invoices and PDFs: email-safe HTML, responsive web HTML, and print-ready PDF HTML from one component tree.
Overview of elements
What it is
Unlayer Elements is an open-source React component library for creating transactional emails, email templates, landing pages, invoices, reports, documents, and PDFs. It allows developers to build content once in React and render it across three output modes: email (compatible with Outlook, Gmail, Yahoo, Apple Mail), web (responsive pages and embedded experiences), and document (print-ready HTML for PDF generation). The library is built and maintained by the team behind Unlayer, a content creation platform.
Key features
- One component tree that renders to email-safe HTML, responsive web HTML, and print-ready PDF HTML.
- Works with React, Next.js, Remix, and Server Components using familiar JSX patterns.
- Generates production output optimized for each destination without separate implementations.
- Compatible with Unlayer's visual builder via
renderToJson()for design JSON export. - TypeScript-first with full type definitions and autocomplete.
renderToHtml()produces clean HTML without React hydration markers or client-side JavaScript.- Lightweight and tree-shakeable: ~12KB gzipped (under 60KB ESM), zero client-side JavaScript required.
Use cases
- Building transactional emails like order confirmations, password resets, and receipts.
- Generating PDFs for invoices, contracts, and reports server-side.
- Rendering CMS-driven content into emails, web pages, and documents from a shared component model.
- Publishing the same content as an email campaign, web archive, and landing page from a single source.
Getting started
bash npm install @unlayer/react-elements tsx import { Email, Row, Column, ColumnLayouts, Heading, Paragraph, Button, renderToHtml } from '@unlayer/react-elements'; function WelcomeEmail() { return ( Welcome! Get Started Get Started ); } const html = renderToHtml();
License and pricing
The project is licensed under MIT. It is open-source and free to use.
Based on the project's public README and repository metadata.