Wrapping code in a component
You can build a component using code and other components, such as:
-
Another Sitecore component.
-
An external BYOC component (web or React component).
-
A piece of HTML and/or JavaScript code.
-
A Form component created in XM Cloud Forms.
You can also use registered external components and Sitecore components directly in the canvas of the page builder. However, there are benefits to first wrapping a component in another Sitecore component in the XM Cloud Components builder. It lets you:
-
Build UI around the code component, for example, to add text, copy, and images around an existing component.
-
Create responsive versions of the code component.
-
Control the styling of the component from XM Cloud Components.
Theme of the Sitecore component cascades down to override the styling of the external components that are being embedded, such as React and web components. This concerns paragraphs, links, headers, and buttons styling.