Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-email/render

Package Overview
Dependencies
Maintainers
3
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-email/render

Transform React components into HTML email templates

  • 0.0.16-canary.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created

What is @react-email/render?

@react-email/render is a package designed to help developers render React components to HTML for email templates. It simplifies the process of creating and managing email templates using React, allowing for dynamic and reusable components.

What are @react-email/render's main functionalities?

Render React Components to HTML

This feature allows you to render React components to HTML, which can then be used as the content of an email. The code sample demonstrates rendering a simple React component to HTML.

const { render } = require('@react-email/render');
const React = require('react');

const MyEmail = () => (
  <div>
    <h1>Hello, World!</h1>
    <p>This is a test email.</p>
  </div>
);

const html = render(<MyEmail />);
console.log(html);

Support for JSX

This feature supports JSX syntax, making it easier to write and manage email templates. The code sample shows a React component using JSX syntax.

const { render } = require('@react-email/render');
const React = require('react');

const MyEmail = () => (
  <div>
    <h1>Hello, World!</h1>
    <p>This is a test email with <strong>JSX</strong> support.</p>
  </div>
);

const html = render(<MyEmail />);
console.log(html);

Dynamic Content

This feature allows for dynamic content in email templates by passing props to React components. The code sample demonstrates rendering a personalized email with a dynamic name.

const { render } = require('@react-email/render');
const React = require('react');

const MyEmail = ({ name }) => (
  <div>
    <h1>Hello, {name}!</h1>
    <p>This is a personalized email.</p>
  </div>
);

const html = render(<MyEmail name="John" />);
console.log(html);

Other packages similar to @react-email/render

Keywords

FAQs

Package last updated on 10 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc