Skip to content

Rule.io SDK


Rule.io SDK / rcml/src / createGroupElement

Function: createGroupElement()

createGroupElement(options): RcmlGroup

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

Build an <rc-group> — a non-responsive wrapper for columns placed directly inside an <rc-section>. Columns inside a group stay side-by-side on mobile instead of stacking with the surrounding columns. At most one group per section (see createSectionElement).

Parameters

options

GroupElementOptions

options.children is the list of <rc-column> children.

Returns

RcmlGroup

A typed RcmlGroup node.

Throws

When any child is not an <rc-column>.

Example

ts
createSectionElement({
  children: [
    createGroupElement({
      children: [
        createColumnElement({ attrs: { width: '50%' }, children: [...] }),
        createColumnElement({ attrs: { width: '50%' }, children: [...] }),
      ],
    }),
  ],
})