Heading
A stylable heading (h1, h2, etc) element
Install
Install the component from your command line
pnpm add jsx-email
bun add jsx-email
npm add jsx-email
yarn add jsx-email
Usage
import { Heading } from 'jsx-email';
const Email = () => { return ( <> <Heading as="h1" mt={20} mb={10}> Main Title </Heading> <Heading as="h2" my={15}> Subtitle </Heading> </> );};
Props
TypeScript Interface
export interface Margin { m?: number | string; mb?: number | string; ml?: number | string; mr?: number | string; mt?: number | string; mx?: number | string; my?: number | string;}
export type PresentAs = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
export type HeadingProps = Margin & { as?: PresentAs };
Optional Props
as
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
HTML heading level to render.
Margin Props
m?: number | string; // marginmx?: number | string; // margin-left + margin-rightmy?: number | string; // margin-top + margin-bottommt?: number | string; // margin-topmr?: number | string; // margin-rightmb?: number | string; // margin-bottomml?: number | string; // margin-left
Margin shorthand properties. Accept pixel values (number) or CSS units (string).
Additional Props
This component expresses all of the Common Component Props for ComponentProps<'h1'>
.