Skip to main content

Component Renderers

The SDK allows advanced users to replace the render function of some components with their own custom solution.

This is achieved through the setCustomRenderer method. It accepts a configuration object with the following parameters:

KeyTypeDescription
sectionString - requiredThe key of the section that needs to be replaced (see the list of overridable sections below).
componentIdString - requiredThe ID of the experience component which the section belongs to
renderFunctionThe custom render function. It accepts predefined parameters (see the list of overridable sections below) and should return HTML as a string.
middlewareFunctionThe custom middleware function to modify predefined parameters (see the list of overridable sections below)
shouldOverrideFunctionA function that accepts the same parameters as render and must return a Boolean. If it returns true the custom render will be displayed.
onDidRenderFunctionA function that accepts the same parameters as render and will be called after the override function ran.
classNameStringOptional CSS classes for the custom renderer container.
styleObjectCustom CSS styles that will be applied to the renderer container.