Add new email components: Content and Header
Two new functionalities for email templates have been introduced. A 'content' component which provides a container complete with border and padding specifications, and a 'header' component which simply encapsulates its child items. Both use the '@react-email/components' container for layout.
This commit is contained in:
19
packages/email-templates/src/components/content.tsx
Normal file
19
packages/email-templates/src/components/content.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Container } from '@react-email/components';
|
||||
import * as React from 'react';
|
||||
|
||||
export function EmailContent(
|
||||
props: React.PropsWithChildren<{
|
||||
className?: string;
|
||||
}>,
|
||||
) {
|
||||
return (
|
||||
<Container
|
||||
className={
|
||||
'rounded-xl my-[8px] px-[24px] py-[12px] mx-auto border border-solid border-[#eeeeee] ' +
|
||||
props.className || ''
|
||||
}
|
||||
>
|
||||
{props.children}
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
10
packages/email-templates/src/components/header.tsx
Normal file
10
packages/email-templates/src/components/header.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Container } from '@react-email/components';
|
||||
import * as React from 'react';
|
||||
|
||||
export function EmailHeader(props: React.PropsWithChildren) {
|
||||
return (
|
||||
<Container>
|
||||
{props.children}
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user