Column
A JSX email component which displays columns that separate content bounaries vertically
Install
Install the component from your command line
console
pnpm add jsx-emailpnpm add jsx-emailconsole
bun add jsx-emailbun add jsx-emailconsole
npm add jsx-emailnpm add jsx-emailconsole
yarn add jsx-emailyarn add jsx-emailUsage
Add the component to your email template. Include styles where needed.
jsx
import { Column, Row } from 'jsx-email';
const Email = () => {
return (
<Row>
<Column>A</Column>
<Column>B</Column>
<Column>C</Column>
</Row>
);
};import { Column, Row } from 'jsx-email';
const Email = () => {
return (
<Row>
<Column>A</Column>
<Column>B</Column>
<Column>C</Column>
</Row>
);
};Component Props
tsx
export interface ColumnProps extends BaseProps<'td'> {
bgColor?: string;
bgImage?: string;
}export interface ColumnProps extends BaseProps<'td'> {
bgColor?: string;
bgImage?: string;
}tsx
bgColor: string;bgColor: string;Used to set the background color in HTML email by wrapping the bgcolor property of <td> elements
tsx
bgImage: string;bgImage: string;Used to set background images in HTML email by wrapping the background property of <td> elements
TIP
This component expresses all of the Common Component Props for ComponentProps<'td'>.