Skip to content

Rule.io SDK


Rule.io SDK / rcml/src / createColumnElement

Function: createColumnElement()

createColumnElement(options): RcmlColumn

Defined in: rcml/src/email/create-rcml-element.ts:696

Build an <rc-column> — a horizontal unit inside an <rc-section>. Holds content elements (text, heading, button, image, divider, social, loops, groups); sections and columns themselves are not valid children.

Parameters

options

ColumnElementOptions

options.children is the list of content elements to stack vertically; options.attrs controls column-level padding, borders, width, vertical alignment.

Returns

RcmlColumn

A typed RcmlColumn node.

Throws

When attrs are invalid or any child is disallowed for columns (e.g. a nested <rc-section>).

Example

ts
createColumnElement({
  attrs: { 'vertical-align': 'top', width: '50%' },
  children: [
    createHeadingElement({ content: 'Welcome' }),
    createTextElement({ content: 'Thanks for joining.' }),
  ],
})