Giter VIP home page Giter VIP logo

react-email's People

Contributors

aadamw avatar bastiaanv avatar bruno88cabral avatar bukinoshita avatar cassiorsfreitas avatar dependabot[bot] avatar enkhee-osiris avatar eymaddis avatar gabrielmfern avatar guscsales avatar gutenye avatar hacksore avatar handotdev avatar jayanratna avatar knoxnoe avatar leonardorpr avatar lordelogos avatar m-shaka avatar mckelveygreg avatar mika-f avatar mzaien avatar niazmorshed2007 avatar pepeladeira avatar renovate[bot] avatar rfoel avatar singhbawan avatar vcapretz avatar vinicoder avatar zehfernandes avatar zenorocha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-email's Issues

Create `Divider` component

A thin horizontal line that separates content areas built on top of <hr>.

Eg:

import { Html } from '@react-email/html';
import { Divider } from '@react-email/divider';

const Email = () => {
  return (
    <Html lang="en">
      <Divider />
    </Html>
  );
};

Create `Html` component

An Html component to wrap the email content.

Eg:

import { Button } from '@react-email/button';
import { Html } from '@react-email/html';

const Email = () => {
  return (
    <Html lang="en">
      <Button href="https://example.com" style={{ color: '#61dafb' }}>
        Click me
      </Button>
    </Html>
  );
};

Add option to inline CSS styles on render

Use juice to inline styles.

import { MyTemplate } from '../components/MyTemplate';
import { render } from '@react-email/render';

const options = {
  inline: true
};

const html = render(<MyTemplate firstName="Jim" />, options);

Add live reload to preview

Nowadays, you have to reload every time you make a change. I'm not sure if that's because of the iframe or something else.

Create `Img` component

Display a responsive image in your email.

Eg:

import { Html } from '@react-email/html';
import { Img } from '@react-email/img';

const Email = () => {
  return (
    <Html>
      <Img src="cat.jpg" alt="Cat" width="300" />
    </Html>
  );
};

Add option to prettify code on render

Use js-beautify as a dependency.

import { MyTemplate } from '../components/MyTemplate';
import { render } from '@react-email/render';

const options = {
  prettify: true
};

const html = render(<MyTemplate firstName="Jim" />, options);

Create live preview mode

The idea is to have a solution for local development, so you don't need to send real emails while testing things out.

Create `Ol` component

Defines an ordered list using a decimal style by default.

import { Html } from '@react-email/html';
import { Ol } from '@react-email/ol';

const Email = () => {
  return (
    <Html lang="en">
      <Ol>
        <li>foo</li>
        <li>bar</li>
      </Ol>
    </Html>
  );
};

Create `Code` component

This is used for defining an inline sample of code.

import { Html } from '@react-email/html';
import { Code } from '@react-email/code';

const Email = () => {
  return (
    <Html lang="en">
      <Code>foo</Code>
    </Html>
  );
};

Create `Ul` component

Defines an unordered list using a bullet style by default.

import { Html } from '@react-email/html';
import { Ul } from '@react-email/ul';

const Email = () => {
  return (
    <Html lang="en">
      <Ul>
        <li>foo</li>
        <li>bar</li>
      </Ul>
    </Html>
  );
};

Create util to handle padding

Whenever the user passes a style prop with padding, we should have an util to handle the padding by adding the msoPaddingAlt attribute as well.

const padding = (style: React.CSSProperties) => {
// Check if there's any padding
return { ...style, msoPaddingAlt: style.padding }
}

Create `P` component

import { Html } from '@react-email/html';
import { P } from '@react-email/p';

const Email = () => {
  return (
    <Html lang="en">
      <P>Lorem ipsum</P>
    </Html>
  );
};

Create `Heading` component

Not much you need to do here, mostly a wrapper around <h1>, <h2>, etc.

Eg:

import { Html } from '@react-email/html';
import { Heading } from '@react-email/heading';

const Email = () => {
  return (
    <Html lang="en">
      <Heading size="1">Lorem</Heading>
      <Heading size="2">Ipsum</Heading>
      <Heading size="3">Dolor</Heading>
      <Heading size="4">Sit</Heading>
      <Heading size="5">Amet</Heading>
      <Heading size="6">Consectetur</Heading>
    </Html>
  );
};

Rename `P` component to `Text`

When trying to find the component, it's way harder to find the right P since the letter may come from a text instead of the component.

Eg:

// cmd + f to find all `P` components to replace, the search will return the `P`s from `Ponei` and `Piano` as well.

<div>
  <P>Ponei</P>
  <P>Piano</P>
</div>

Create `Pre` component

This is used to preserve spaces, line breaks and tabs in the text. So how you format the code in the HTML file is how it will look on the screen.

import { Html } from '@react-email/html';
import { Pre } from '@react-email/pre';

const Email = () => {
  return (
    <Html lang="en">
      <Pre>foo          bar</Pre>
    </Html>
  );
};

Create `Preview` component

A text snippet that appears under the subject line in the inbox but is hidden from the main email content when it’s opened.

Eg:

import { Html } from '@react-email/html';
import { Preheader } from '@react-email/preheader';

const Email = () => {
  return (
    <Html lang="en">
      <Preheader text="Lorem ipsum" />
    </Html>
  );
};

Create Outlook component

A component for internal usage to be used to replace the usage of the not so sexy syntax for outlook

Create `Container` component

Something to give the content a max-width and center it in the email body. Maybe include props for max-width values and alignment?

import { Button } from '@react-email/button';
import { Html } from '@react-email/html';
import { Container } from '@react-email/container';

const Email = () => {
  return (
    <Html lang="en">
      <Container maxWidth="400" align="center" style={{ backgroundColor: '#fff' }}>
        <Button href="https://example.com" style={{ color: '#61dafb' }}>
          Click me
        </Button>
      </Container>
    </Html>
  );
};

Create `A` component

import { Html } from '@react-email/html';
import { A } from '@react-email/a';

const Email = () => {
  return (
    <Html lang="en">
        <A href="https://example.com">Example</A>
    </Html>
  );
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.