Is it possible to create a generic component and use different styles for it in different pages?

I’m developing an app in Ionic 5 and for listing some grouped items I decided to use a generic accordion component, but I’m running into a problem. Depending on the page that I use the component, I need to change almost every class and style inside the component for showing the items in the desired way.

The question is, can I use a generic component but with a dynamic style (css)?

You can use your own custom CSS Variables in the Component’s Style. Then in the Page where you use that Component, you can apply a Class to it and use the created Variables :blush:

1 Like

That’s the correct answer, but unfortunately my generic component was not structurally generic, so only changing the style wasn’t enought. Thank you so much for the help.