<my-button><template> and <slot> for content projectionclass MyCard extends HTMLElement {
connectedCallback() {
const shadow = this.attachShadow({ mode: 'open' });
shadow.innerHTML = `
`;
}
}
customElements.define('my-card', MyCard);
// Usage in HTML:
// Content here
Web Components are a native standard with no dependencies. React/Vue are libraries with better DX and ecosystem. They can be combined: Lit (Google) simplifies writing Web Components.