Web Components are three browser features: Custom Elements, Shadow DOM, and HTML Templates. Together they give you encapsulated components in plain HTML.
Define a class extending HTMLElement, register it with customElements.define, and use it as a tag. Shadow DOM scopes styles; ::part exposes styling slots; CSS custom properties let consumers theme the component.
It is the right tool for design systems that need to work across React, Vue, Svelte, and plain HTML at once. Lit (8KB) adds reactivity and template syntax if you want it.