Blocks
Heading
A heading, from level 1 (the page's title) to 6. The Heading component's props, styles and an example, in Hyper Elements.
import { Heading } from "@hyper-elements/react";Example
SHIP EMAILS LIKE CODE A LEVEL-2 HEADING UNDER IT
- infoemail/outlook-degraded
letterSpacing on this Heading in classic Outlook: normal spacing: Word keeps letter spacing but doesn't draw it
root.children[0].children[0].children[0].style.letterSpacing
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="x-apple-disable-message-reformatting"><!--[if !mso]><!--><meta http-equiv="X-UA-Compatible" content="IE=edge"><!--<![endif]--><meta name="format-detection" content="telephone=no,address=no,email=no,date=no,url=no"><meta name="color-scheme" content="light"><meta name="supported-color-schemes" content="light"><!--[if mso]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--><style>table,td{mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse}img{-ms-interpolation-mode:bicubic}a[x-apple-data-detectors]{color:inherit!important;text-decoration:none!important}@media (max-width: 540px){.egtlvf{font-size:26px!important;line-height:32.5px!important}}</style></head><body style="margin:0;padding:0;-webkit-text-size-adjust:100%;background-color:#fff"><div role="article" aria-roledescription="email" style="background-color:#fff;overflow-wrap:break-word;word-break:break-word"><table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor="#ffffff" style="background-color:#fff"><tr><td align="center"><!--[if mso]><table role="presentation" cellpadding="0" cellspacing="0" border="0" width="520" align="center"><tr><td><![endif]--><table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%" style="max-width:520px"><tr><td><table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td style="padding:24px"><table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td><table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td style="padding-bottom:6px"><h1 class="egtlvf" style="margin:0;color:#0f172a;font-family:Inter, Helvetica, Arial, sans-serif;font-size:32px;font-weight:700;line-height:40px;mso-line-height-rule:exactly;letter-spacing:-0.5px;text-align:left">Ship emails like code</h1></td></tr><tr><td><h2 style="margin:0;color:#475569;font-family:Inter, Helvetica, Arial, sans-serif;font-size:20px;font-weight:500;line-height:25px;mso-line-height-rule:exactly;text-align:left">A level-2 heading under it</h2></td></tr></table></td></tr></table></td></tr></table></td></tr></table><!--[if mso]></td></tr></table><![endif]--></td></tr></table></div></body></html>Show the code
import { Column, Email, Heading } from "@hyper-elements/react";
export default function Example() {
return (
<Email width={520} style={{ backgroundColor: "#ffffff", fontFamily: "Inter, Helvetica, Arial, sans-serif", color: "#0f172a", gap: 16 }}>
<Column style={{ padding: 24, gap: 16 }}>
<Column style={{ gap: 6 }}>
<Heading level={1} style={{ fontSize: 32, letterSpacing: -0.5 }} mobile={{ fontSize: 26 }}>
Ship emails like code
</Heading>
<Heading level={2} style={{ fontSize: 20, color: "#475569", fontWeight: 500 }}>
A level-2 heading under it
</Heading>
</Column>
</Column>
</Email>
);
}Reference
A heading, from level 1 (the page’s title) to 6.
Holds: text; PageNumber, Span, Link, LineBreak, MergeTag. Drawn in: email, page.
Props:
level: one of 1, 2, 3, 4, 5, 6 (default1)dir: one of “ltr”, “rtl”, “auto”. Its text’s direction, where it differs from the template’s; it starts on that side unless aligned otherwise.
style:
color: color (inherited)fontFamily: fontFamily (inherited)fontSize: a length (a number of px) (inherited)fontWeight: fontWeight (default700, inherited)fontStyle: one of “normal”, “italic” (inherited)lineHeight: lineHeight (default1.25, inherited)letterSpacing: a length (a number of px) (inherited)textAlign: one of “left”, “center”, “right”, “justify” (inherited)textTransform: one of “none”, “uppercase”, “lowercase”, “capitalize” (inherited)textDecoration: one of “none”, “underline”, “line-through”width: a length (a number of px, %)maxWidth: a length (a number of px, %)padding: insetsbackgroundColor: colorborder: borderborderRadius: radiusflex: flex. In a Row: its share of the width left after children with a width (default 1); “none” takes its own size.
mobile (on phones): fontSize, lineHeight, letterSpacing, textAlign, width, maxWidth, padding, border.