0.1.0 • Published 6 months ago
@jsx-email/code v0.1.0
@jsx-email/code
Requirements
This package requires an LTS Node version (v18.0.0+) and React v18.2.0+.
Install
pnpm add @jsx-email/code
# We recommend pnpm - https://pnpm.io
# But npm and yarn are supported
# npm add @jsx-email/code
# yarn add @jsx-email/code
Usage
We recommend using the @jsx-email/cli
for creating new templates.
Create an email template file (e.g. Email.tsx
) and import the component:
import { getCode } from '@jsx-email/code';
const Code = await getCode({ language: 'js', theme: 'nord' });
const Email = () => {
return (
<Code>
{`
import { batman } from 'superheros';
import { joker } from 'villains';
const henchmen = joker.help();
batman.fight(henchmen);
batman.arrest(joker);
`}
</Code>
);
};
Please see the @jsx-email/code
Documentation for props and additional usage information.
License
0.1.0
6 months ago