Adding Style to Custom Component in Sitecore XM Cloud Component Builder

When you working on components in XM Cloud, there is always a need to provide the styling to it. In NextJs component it is pretty clear as you can add the classes to the elements, but when you are creating the components using XM Cloud component builder then things becomes much more easy.

In my previous blog, I have shown how you can create a no-code component using the xm cloud component builder and in this blog i will show you how you can provide style to the controls in component builder.

Please note, Since Sitecore has released its AI version and now being called SitecoreA , so i have updated this blog as per new options available in XM Cloud.

Reaching out to Components Section

Step 1: Click on your site and select Design Studio option


Step 2: Click on Component option



Create Component


Step 3: Now lets create a new component




Creating Elements

Step 4: Create few elements


Currently i have added 2 types of elements, one is heading and other is text. See on right section, they provide you the options to style it.

For both of the elements, the styling properties will get changed.

Lets do it for heading.

Step 5: Styling heading and Text fields

Lets change the color to light grey, for that go to 



Now you should be able to see the heading text in that color, now lets change the font size, for that goto:







Now, when you click on the text inside the Heading Box, you will see the new style options:




Similar kind of options you will get in text field as well.





Step 6: Adding Image Element and styling it

First add the image element and provide some source to it:


Below is the section where you can style the image section.


Lets try setting sizing property:



You can add custom spacing as well:


Now lets publish the component


Once the component is published, it should get available in component section in page builder:
Now this component is ready to be applied on any page item.

Similarly according the elements you use while creating the component, the styling properties gets changed.

References:







Comments

Popular posts from this blog

Working with Device Detection Module in Sitecore

Setup A/B Testing in Sitecore - Part 1

Resolving: Failed to start service Sitecore Marketing Automation Engine Error