Sections and layout
Column
Stacks its children vertically, with its own spacing and box. The Column component's props, styles and an example, in Hyper Elements.
import { Column } from "@hyper-elements/react";Example
A card is a Column Background, padding, radius and a gap between what it holds. No margins anywhere. Open (https://example.com)
- infoemail/outlook-degraded
borderRadius on this Column in classic Outlook: square corners
root.children[0].children[0].style.borderRadius - infoemail/outlook-degraded
borderRadius on this Button 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}</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%" style="border-collapse:separate"><tr><td bgcolor="#0f172a" style="padding:28px;background-color:#0f172a;border-radius:12px"><table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td style="padding-bottom:12px"><h3 style="margin:0;color:#fff;font-family:Inter, Helvetica, Arial, sans-serif;font-size:20px;font-weight:700;line-height:25px;mso-line-height-rule:exactly;text-align:left">A card is a Column</h3></td></tr><tr><td style="padding-bottom:12px"><p style="margin:0;color:#94a3b8;font-family:Inter, Helvetica, Arial, sans-serif;font-size:16px;line-height:24px;mso-line-height-rule:exactly;text-align:left">Background, padding, radius and a gap between what it holds. No margins anywhere.</p></td></tr><tr><td><table role="presentation" cellpadding="0" cellspacing="0" border="0" style="border-collapse:separate"><tr><td align="center" bgcolor="#ef4638" style="background-color:#ef4638;border-radius:6px;mso-padding-alt:10px 20px"><a href="https://example.com" style="display:inline-block;padding:10px 20px;color:#fff;font-family:Inter, Helvetica, Arial, sans-serif;font-size:14px;line-height:16.8px;mso-line-height-rule:exactly;text-align:center;text-decoration:none;border-radius:6px">Open</a></td></tr></table></td></tr></table></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 { Button, Column, Email, Heading, Text } 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={{ backgroundColor: "#0f172a", color: "#e2e8f0", borderRadius: 12, padding: 28, gap: 12 }}>
<Heading level={3} style={{ fontSize: 20, color: "#ffffff" }}>A card is a Column</Heading>
<Text style={{ color: "#94a3b8" }}>Background, padding, radius and a gap between what it holds. No margins anywhere.</Text>
<Button href="https://example.com" style={{ backgroundColor: "#ef4638", borderRadius: 6, alignSelf: "start" }}>Open</Button>
</Column>
</Column>
</Email>
);
}Reference
Stacks its children vertically, with its own spacing and box.
Holds: Row, Column, Grid, Layer, Svg, Text, Heading, Link, Button, Image, Divider, List, Table, Video, Social, Menu, Html. Drawn in: email, page.
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.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.