function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Caleb Kuester 44Caleb Kuester 44 

LWC Markup Inheritance?

It seems that this is not possible, or not supported. Basically, the idea is that I would like to make something like a spinner in an extensible component and then allow other components to gain access to that spinner by inheritance.

I'm able to inherit JS functions just fine, but I'm not seeing a page that's able to succinctly show markup being transferrable by inheritance as an option. A couple even outright say it won't work.

Curious on what the final verdict is.
Best Answer chosen by Caleb Kuester 44
PriyaPriya (Salesforce Developers) 
Hey Caleb,

It is prohibited by the framework. It is not possible to inherit. Kindly refer below examples :-

https://salesforce.stackexchange.com/questions/332960/the-differences-between-aura-and-lwc-inheritance-how-to-inherit-the-ui-html-mar

https://salesforce.stackexchange.com/questions/266236/any-ways-to-extend-a-components-template-in-lwc

Thanks!