Skip to content

Rule.io SDK


Rule.io SDK / rcml/src / createWrapperElement

Function: createWrapperElement()

createWrapperElement(options): RcmlWrapper

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

Build an <rc-wrapper> — groups <rc-section> and <rc-switch> children under a shared background, padding, and border. Useful for applying visual treatment to a block of sections without repeating it on each one.

Parameters

options

WrapperElementOptions

options.children is the list of wrapped sections / switches; options.attrs controls shared background / padding / border / full-width behavior.

Returns

RcmlWrapper

A typed RcmlWrapper node.

Throws

When attrs are invalid or any child is neither an <rc-section> nor an <rc-switch>.

Example

ts
createWrapperElement({
  attrs: { 'background-color': '#f3f3f3', padding: '40px 0' },
  children: [createSectionElement({ children: [...] })],
})