7. Custom styling the Web-Components
Web-Components are the most convenient way to integrate functionalities in your application. Like any other UI elements in your application we provide simple ways to style these Web-Components so they become part of your application for a seamless user experience.
Below you will find examples in some popular frontend frameworks.
The library must be loaded before custom styling can be used in your application. To enable the library, please refer to our guide Loading the frontend library.
For a complete list of customizable style elements please refer to our guide JS Client Library Properties and Styling section.
React
Step 1. Install the npm package
Step 2. Create CSS module file for your component (MyComponent.module.css)
Important: CSS Modules are turned on for files ending with .module.css
extension. This is required for styling to function properly.
Step 3. Import and apply styles in your React component
Vue.js
With Vue.js we have two options available and you can choose what best fits your application architecture.
Step 1. Install the npm package
Step 2. Create modular <style> in your component and apply to Web-Component
Option1 - Via style module within your .vue file
Option 2 - CSS module file for your component (MyComponent.module.css)
Important: CSS Modules are turned on for files ending with .module.css
extension. This is required for styling to function properly if you decide to use this option.
Create MyComponent.module.css
2. Create MyComponent.vue
Last updated