Documentation Index
Fetch the complete documentation index at: https://react.email/docs/llms.txt
Use this file to discover all available pages before exploring further.
Install
Install the component from your command line.Getting Started
Add the component into your email component as follows.Theming
Themes for this component are basically a set of styles for each kind of token that can result from prismjs’s tokenization. See here for more information on the tokens available. An example of a theme would be this:React elements.
As you can see from the example dracula theme though, there is a defined property called base which is the styling for the pre element that wraps the HTML being rendered.
For you to not need to defined a theme without any basis, or to not define one that already has been defined, we have many default themes exported from react-email.
These themes were generated by a bit of code that converts a CSS file for a prismjs theme into a object theme of these.
If you want to generate a theme from another existing prismjs theme you can do so by looking into this.
Props
Whether or not to automatically include line numbers on the rendered code block
The font family value to go into the
fontFamily: "..." style for
all used elements of the componentAn object representation of a PrismJS CSS theme
The language under the supported languages defined in
PrismLanguageThe actual code to render in the code block. Just a plain string, with the proper indentation included.