Class and objects : same as any language?

hello masters!

I use the same type of custom card with some pieces of code to achieve specific behavior (mushroom template card)

The behaviour can be:

  • change icon color if the state of entity changes
  • change secondary info if any condition applied
    etc

My question is:
Can i create a “class card” derivating from some existent card and instance objects from this class to use as card in my dashboards?

Using the logic of any OOP language: to change the behaviour of a object only i need is to change the class.