Typography
These components handle text rendering and other common content elements. They are imported from hono-email:
import { Text, Heading, Link, Button, Img, Hr, CodeInline, CodeBlock, List, ListItem,} from 'hono-email'<Text>
Section titled “<Text>”Paragraph element with email-friendly defaults.
Defaults: font-size: 14px, line-height: 24px, margin: 16px 0
Accepts all standard <p> attributes and style to override defaults.
<Text style={{ color: '#374151', fontSize: '16px' }}>Thanks for signing up.</Text><Heading>
Section titled “<Heading>”Heading element with shorthand margin props.
<Heading as="h2" mt={0} mb={16}> Account summary</Heading>as Optional
Section titled “as ”Type: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' · Default: 'h1'
Margin shorthands Optional
Section titled “Margin shorthands ”m, mx, my, mt, mr, mb, ml — shorthand margin props. Numbers are converted to pixels.
<Link>
Section titled “<Link>”Anchor element. Requires href.
<Link href="https://example.com/account">View your account</Link>href Required
Section titled “href ”Type: string
target Optional
Section titled “target ”Type: string · Default: '_blank'
<Button>
Section titled “<Button>”Call-to-action link rendered with Outlook-compatible button padding.
<Button href="https://example.com/confirm" style={{ backgroundColor: '#111827', color: '#ffffff', padding: '12px 24px', borderRadius: '6px', }}> Confirm your email</Button>href Required
Section titled “href ”Type: string
target Optional
Section titled “target ”Type: string · Default: '_blank'
Image element. src and alt are both required.
<Img src="https://example.com/logo.png" alt="Company Logo" width={120} height={40} />src Required
Section titled “src ”Type: string
alt Required
Section titled “alt ”Type: string
Descriptive alt text for accessibility and clients that block images.
Horizontal rule.
Default: border-top: 1px solid #eaeaea, width: 100%
<Text>Order details</Text><Hr /><Text>Total: $42.00</Text><CodeInline>
Section titled “<CodeInline>”Inline code span.
Defaults: font-family: monospace, background: #f3f4f6, font-size: 13px, padding: 2px 4px
<Text> Run <CodeInline>npm install hono-email</CodeInline> to get started.</Text><CodeBlock>
Section titled “<CodeBlock>”Preformatted code block.
Defaults: font-family: monospace, background: #f3f4f6, font-size: 13px, white-space: pre-wrap
<CodeBlock>{`curl -X POST https://api.example.com/send`}</CodeBlock><List> / <ListItem>
Section titled “<List> / <ListItem>”Ordered or unordered lists.
<List ordered> <ListItem>Confirm your email address</ListItem> <ListItem>Set up your profile</ListItem> <ListItem>Invite your team</ListItem></List>ordered Optional
Section titled “ordered ”Type: boolean
Render an <ol> when true, <ul> otherwise.
marker Optional
Section titled “marker ”Type: string
CSS list-style-type value (e.g. 'disc', 'decimal', '"→ "').