PML components

PML (Piko Mail Language) is the tag vocabulary used inside email .pk templates. Each PML tag renders to email-safe HTML with table-based layout, automatic Outlook VML fallbacks for buttons and backgrounds, and responsive mobile behaviour. This page documents every tag and its attributes. For task recipes see the email templates how-to. For the rendering pipeline that wraps this vocabulary see the premailer reference. Source of truth: internal/pml/pml_components/.

Layout hierarchy

PML enforces a parent-child structure that mirrors the HTML tables it emits:

(implicit body root)
├── <pml-container>           # Optional grouping wrapper
│   └── <pml-row>
│       └── <pml-col>
│           ├── <pml-p>
│           ├── <pml-button>
│           ├── <pml-img>
│           ├── <pml-br>
│           ├── <pml-hr>
│           ├── <pml-ul> / <pml-ol>
│           │   └── <pml-li>
│           └── <pml-hero>
└── <pml-row>                 # Rows can live directly under the implicit root

pml-body is not a tag you write. The validator references it as the synthetic name for the implicit root, so pml-row, pml-container, and pml-hero declare pml-body as an allowed parent to indicate "may appear at the top level of the template". The sections Structural components, Hero, Content components, and List components below cover the thirteen registered components.

The validator at internal/pml/pml_domain/validator.go rejects templates that break this structure at build time.

Structural components

pml-container

Groups multiple pml-rows under a shared background without adding extra padding.

AttributeTypeDefaultEffect
background-colorcolourContainer background.
background-urlstringBackground image; triggers Outlook VML fallback.
background-repeatrepeat \| no-repeatrepeat
background-sizestringauto
background-positionstringtop center
borderstringShorthand border.
border-radiusunit
directionltr \| rtlltr
full-widthbooleanfalseSpans viewport instead of 600 px.
paddingunit0Overrides the row default so grouped sections do not double-pad.
text-alignleft \| center \| rightcenter

Renders as nested <table> with <tbody>/<tr>/<td>, equivalent to pml-row with stack-children="true".

Allowed parents: pml-body.Allowed children: pml-row.

pml-row

A horizontal strip of content. Columns inside sit side by side on desktop and stack on mobile.

AttributeTypeDefaultEffect
background-colorcolour
background-urlstringTriggers a <v:rect> VML block for Outlook.
background-repeatrepeat \| no-repeatrepeat
background-sizestringauto
background-positionstringtop centerAccepts background-position-x / -y overrides.
borderstring
border-radiusunit
css-classstringAdded to the wrapper.
directionltr \| rtlltr
full-widthbooleanfalseMakes the background span the viewport; the content stays within 600 px.
paddingunit20pxOuter padding.
padding-top/-right/-bottom/-leftunitIndividual overrides.
stack-childrenbooleanfalseForce mobile stacking even on desktop.
text-alignleft \| center \| rightcenter
text-paddingunit0Padding applied around text-only cells.

Renders as an outer <table> (full-width mode) or a boxed <div> + table with Outlook <!--[if mso | IE]> conditionals wrapping each child column in a <tr>/<td>.

Allowed parents: pml-body, pml-container.Allowed children: pml-col, pml-no-stack.

pml-col

A vertical cell inside a row.

AttributeTypeDefaultEffect
background-colorcolourOuter-cell background.
inner-background-colorcolourInner-content background.
borderstring
inner-borderstringApplied to the gutter table.
border-radiusunit
inner-border-radiusunit
paddingunit0
vertical-aligntop \| middle \| bottomtop
widthunit or %autoWhen omitted, equal width splits among siblings.
directionltr \| rtlltr
css-classstring

Renders as a <div> with display: inline-block. The parent pml-row inserts Outlook conditional tables so columns stay side-by-side in Outlook.

Responsive behaviour. The compiler emits a CSS class named pml-col-N (for example pml-col-50 when width="50%"). On viewports below the mobile breakpoint, that class forces display: block with full width.

Allowed parents: pml-row, pml-no-stack.Allowed children: pml-p, pml-button, pml-img, pml-hero, pml-br, pml-ul, pml-ol, pml-hr.

pml-no-stack

Opts its pml-col children out of mobile stacking.

AttributeTypeDefaultEffect
No attributes.

Allowed parents: pml-body, pml-container.Allowed children: pml-col.

Hero

pml-hero

A full-width banner that layers content over a background image.

AttributeTypeDefaultEffect
modefluid-height \| fixed-heightfixed-height requires height.
heightunitRequired for fixed-height.
background-urlstring
background-widthunitImage intrinsic width.
background-heightunitImage intrinsic height.
background-positionstringcenter
background-sizestringcover
background-colorcolourFallback background behind the image.
container-background-colorcolour
inner-background-colorcolour
paddingunitOuter padding.
inner-paddingunitContent padding.
vertical-aligntop \| middle \| bottom
alignleft \| center \| right
border-radiusstring

Allowed parents: pml-body, pml-container.Allowed children: pml-p, pml-button, pml-img.

Content components

pml-p

A paragraph with text styling.

AttributeTypeDefaultEffect
alignleft \| center \| right \| justifyleft
colorcolour#000000
background-colorcolour
font-familystringUbuntu, Helvetica, Arial, sans-serif
font-sizeunit13px
font-stylestringnormal
font-weightstringnormal
line-heightstring1
paddingunit10px 25px

Renders as a <td> inside a wrapper <table>. The renderer passes inline HTML inside (<b>, <i>, <a>, <span>) through unchanged.

Allowed parents: pml-col, pml-hero.

pml-button

A call-to-action button. Generates a VML <v:roundrect> fallback for Outlook.

AttributeTypeDefaultEffect
hrefstringRequired for a linked button.
targetstring_blank
relstring
titlestring
alignleft \| center \| rightcenter
background-colorcolour#414141
container-background-colorcolourApplied to the button's container cell.
colorcolour#ffffffText colour.
borderstringnone
border-radiusunit3px
font-familystringUbuntu, Helvetica, Arial, sans-serif
font-sizeunit13px
font-weightstringnormal
heightunit
widthunit
inner-paddingunit10px 25pxPadding around the text.
paddingunit10px 25pxOuter padding on the container cell.
line-heightunit120%
text-decorationstringnone
text-transformstringnone
vertical-aligntop \| middle \| bottommiddle

Allowed parents: pml-col, pml-hero.Children. Plain text or inline HTML (span, strong, em). Complex nested HTML does not survive the VML fallback, so keep button labels simple.

pml-img

An image, optionally linked, with responsive and high-DPI support.

AttributeTypeDefaultEffect
srcstringRequired.
altstring
hrefstringWraps the image in an <a>.
target, rel, title, namestring
widthunitauto
heightunitauto
max-heightunit
alignleft \| center \| rightcenter
border / border-*stringnone
border-radiusunit
paddingunit10px 25px
padding-*unit
container-background-colorcolour
font-sizeunit0
fluid-on-mobilebooleanfalseMakes the image 100 % wide below the mobile breakpoint.
full-widthbooleanfalseAlways 100 % wide.
srcsetstringBrowser-native responsive-image srcset.
sizesstring
densitiesstringShortcut: "x1 x2" generates an automatic srcset at 1x and 2x.
profilestringAsset transform profile name for the Piko asset pipeline.

CID embedding. When rendering the template for an email, the pipeline automatically rewrites src references to project assets as cid: URLs and attaches the assets to the outgoing message. The EmailAssetRegistry inside the PML transformer collects these.

Allowed parents: pml-col, pml-hero.

pml-br

A context-sensitive line break or vertical spacer.

AttributeTypeDefaultEffect
heightunit20pxSpacer height when used inside a column.
paddingunit
css-classstring

Rendering depends on parent:

  • Inside pml-col or pml-hero: renders as a <table> with an empty <td> styled to the given height.
  • Inside pml-p or pml-li: renders as a plain <br>.

Allowed parents. Any.

pml-hr

A horizontal rule.

AttributeTypeDefaultEffect
borderstring4px solid #000000Short-hand for colour, width, style.
border-colorcolour
border-widthunit
border-stylestring
paddingunit10px 25px
alignleft \| center \| rightcenter
css-classstring

Allowed parents: pml-col, pml-hero.

List components

pml-ul

An unordered list.

AttributeTypeDefaultEffect
align, color, font-family, font-size, line-height, paddinginheritedSame set as pml-p.

Allowed parents: pml-col, pml-hero.Allowed children: pml-li.

pml-ol

An ordered list.

AttributeTypeDefaultEffect
list-styleordered \| unorderedorderedDrives the underlying list rendering. pml-ul shares the rendering helper but registers under its own tag.
align, color, font-family, font-size, line-height, paddinginherited

Allowed parents: pml-col, pml-hero.Allowed children: pml-li.

pml-li

A list item.

AttributeTypeDefaultEffect
Inherits text styling from the parent list.

Allowed parents: pml-ul, pml-ol.

Outlook VML fallbacks

Two tags automatically emit Microsoft-specific VML markup wrapped in <!--[if mso | IE]> conditionals:

ComponentVML emittedPurpose
pml-row with background-url<v:rect> with <v:fill>Renders the background image in Outlook desktop.
pml-button with href<v:roundrect> with <v:textbox>Renders a clickable pill button in Outlook desktop.

Outside Outlook, the conditionals are invisible comments.

Mobile breakpoint

The default breakpoint is 480 px. Below it:

  • pml-cols stack full-width unless the containing row uses stack-children="false" or sits inside pml-no-stack.
  • pml-img with fluid-on-mobile="true" stretches to 100 % width.

Override the breakpoint through premailer config (see the premailer reference).

See also