Best Practices for Extending/Subclassing Components?

Is there a way to efficiently extend components/created classes to other components. For example, I have a component (first component) with a certain HTML structure, but I want to iterate and change it slightly for another component (second component) that shares every other aspect of that first co…