Sections and layout
Row
Lays its children out side by side. A child takes its width, or a share of what's left (its flex, 1 by default).
import { Row } from "@hyper-elements/react";Example
140px flex: 2 flex: 1
- infoemail/outlook-degraded
borderRadius on this Column in classic Outlook: square corners
root.children[0].children[0].children[0].style.borderRadius - infoemail/outlook-degraded
borderRadius on this Column in classic Outlook: square corners
root.children[0].children[0].children[1].style.borderRadius - infoemail/outlook-degraded
borderRadius on this Column in classic Outlook: square corners
root.children[0].children[0].children[2].style.borderRadius
<!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){.eezu4q>div{width:100%!important;max-width:100%!important}.eqan3y{height:12px!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 class="eezu4q" style="font-size:0"><!--[if mso]><table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td width="140" valign="top" style="width:140px"><![endif]--><div style="display:inline-block;vertical-align:top;width:100%;max-width:140px;font-size:16px"><table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%" style="border-collapse:separate"><tr><td bgcolor="#fee2e2" style="padding:16px;background-color:#fee2e2;border-radius:8px"><table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td><p style="margin:0;color:#0f172a;font-family:Inter, Helvetica, Arial, sans-serif;font-size:16px;font-weight:700;line-height:24px;mso-line-height-rule:exactly;text-align:left">140px</p></td></tr></table></td></tr></table></div><!--[if mso]></td><td width="12" style="width:12px"></td><![endif]--><!--[if !mso]><!--><div class="eqan3y" style="display:inline-block;width:12px"></div><!--<![endif]--><!--[if mso]><td width="195" valign="top" style="width:195px"><![endif]--><div style="display:inline-block;vertical-align:top;width:100%;max-width:195px;font-size:16px"><table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%" style="border-collapse:separate"><tr><td bgcolor="#e0e7ff" style="padding:16px;background-color:#e0e7ff;border-radius:8px"><table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td><p style="margin:0;color:#0f172a;font-family:Inter, Helvetica, Arial, sans-serif;font-size:16px;font-weight:700;line-height:24px;mso-line-height-rule:exactly;text-align:left">flex: 2</p></td></tr></table></td></tr></table></div><!--[if mso]></td><td width="12" style="width:12px"></td><![endif]--><!--[if !mso]><!--><div class="eqan3y" style="display:inline-block;width:12px"></div><!--<![endif]--><!--[if mso]><td width="113" valign="top" style="width:113px"><![endif]--><div style="display:inline-block;vertical-align:top;width:100%;max-width:113px;font-size:16px"><table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%" style="border-collapse:separate"><tr><td bgcolor="#dcfce7" style="padding:16px;background-color:#dcfce7;border-radius:8px"><table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td><p style="margin:0;color:#0f172a;font-family:Inter, Helvetica, Arial, sans-serif;font-size:16px;font-weight:700;line-height:24px;mso-line-height-rule:exactly;text-align:left">flex: 1</p></td></tr></table></td></tr></table></div><!--[if mso]></td></tr></table><![endif]--></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, Text, Row } 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 }}>
<Row style={{ gap: 12 }}>
<Column style={{ width: 140, backgroundColor: "#fee2e2", borderRadius: 8, padding: 16 }}>
<Text style={{ fontWeight: 700 }}>140px</Text>
</Column>
<Column style={{ flex: 2, backgroundColor: "#e0e7ff", borderRadius: 8, padding: 16 }}>
<Text style={{ fontWeight: 700 }}>flex: 2</Text>
</Column>
<Column style={{ backgroundColor: "#dcfce7", borderRadius: 8, padding: 16 }}>
<Text style={{ fontWeight: 700 }}>flex: 1</Text>
</Column>
</Row>
</Column>
</Email>
);
}Reference
Lays its children out side by side. A child takes its width, or a share of what’s left (its flex, 1 by default).
Holds: Row, Column, Grid, Layer, Svg, Text, Heading, Link, Button, Image, Divider, List, Table, Video, Social, Menu, Html. Drawn in: email, page.
Props:
stackOnMobile: true or false (defaulttrue). Its children stack full-width on phones (in an Email or a Page).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 (inherited)fontStyle: one of “normal”, “italic” (inherited)lineHeight: lineHeight (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)width: a length (a number of px, %)minWidth: a length (a number of px, %)maxWidth: a length (a number of px, %)height: a length (a number of px)padding: insetsbackgroundColor: colorborder: borderborderRadius: radiusoverflow: one of “visible”, “hidden”. Whether content past a set height is cut off.gap: a length (a number of px). Space between children.alignItems: one of “start”, “center”, “end”, “stretch”. Where children sit across the layout’s direction (vertically in a Row, horizontally in a Column), as CSS align-items. Across a Column it places what has its own size (a Button, an Image, an Svg, a box with a width); a block of text fills the width, so its words move with its textAlign.justifyContent: one of “start”, “center”, “end”, “space-between”. Where children sit along the layout’s direction, as CSS justify-content.flexWrap: one of “nowrap”, “wrap”, “words”. “wrap”: children that don’t fit wrap onto another line, as CSS flex-wrap (in an email, in a Row kept side by side on phones, with no gap between the lines). “words”: in an email, also a space of the text’s font apart, on lines at least as tall as its, as words are.flex: 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, gap.