SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
β€’ Open full site

Add Custom Styles and Components for UI5 Web Components for React

Add custom styles and custom components to your application using UI5 Web Components for React.

Overview

🎓 beginner 10 min. HTML5BeginnerSAP Fiori

You will learn

  • βœ”How to change style of existing components
  • βœ”How to style own components
Lukas Harbarth L Lukas Harbarth September 18, 2025
Created by November 29, 2019
Contributors

Prerequisites

Steps

Intro

In this tutorial, you will learn how to apply styling to the UI5 Web Components. You can add custom styles and even overwrite CSS Variables on any level. Also, you’ll learn how to style your custom components with the styling approach of SAP Fiori.


Step 1 Change style for existing components
β€”

You can change the appearance of the UI5 Web Components by using CSS Variables. Per default, the Horizon theme parameters are added to the adoptedStyleSheets of the document. For example, if you want to change the color of all texts that use the --sapTile_TitleTextColor variable, you can create an additional style rule overriding the value of the CSS variable.

Open the index.css file inside your src folder and add the following content:

CSS
* {
  --sapTile_TitleTextColor: limegreen;
}

The sapTile_TitleTextColor CSS Variable is used in the CardHeader component to set the color of the title. With the * selector, you can apply styles to all elements in the subtree and therefore change the color of all components using sapTile_TitleTextColor.

Custom Style
Custom Style

As a consequence, all HTML Elements in the subtree where this style was applied are now displaying their texts in limegreen instead of rgb(29, 45, 62) which would be the default value for Horizon. You can change CSS Variables on any level - in the head, or on every single element by using either CSS classes or element style.

A full list of all supported CSS Variables can be found in the ThemingParameters object or in the theming-base-content repository.

Warning: Overriding the value of CSS variables changes it for all themes and therefore can cause inconsistencies!

Step 2 Style your own component
+
Step 3 SAP UI Common CSS
+
Step 4 Conclusion
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 4
1. Change style for existing components 2. Style your own component 3. SAP UI Common CSS 4. Conclusion

Learn more →