Implementing Cross-Framework Integration Web Components
We often encounter a situation: a team builds a universal Web Components library, but when integrating into React events are not caught, in Angular there's a schema error, and in SSR components crash. Sound familiar? We solve these problems, guaranteeing compatibility and providing ready-made wrappers for each framework. Our solutions cover React Web Components, Vue Web Components, and Angular Web Components. We can evaluate your project in one day. Our clients save up to 40% integration time (average 35%) thanks to ready-made solutions. Integration packages start from $2,000 per framework, with a 98% satisfaction rate from 50+ completed projects. Typical savings: $800 per framework due to reduced development time.
Problems We Solve
React: Object Passing and Events (Custom Elements React)
For React Web Components, React before version 19 does not pass objects and arrays through attributes — everything is converted to the string [object Object]. Custom DOM events are not automatically caught. Our solution — ref + useEffect to set properties and subscribe to events. React 19 improves support by allowing direct object passing and custom elements React can be enhanced with wrappers like @lit/react. But even in version 19, compatibility checks are required.
Angular: Schema and Two-Way Binding
Angular Web Components require adding CUSTOM_ELEMENTS_SCHEMA to the module or standalone component. For two-way binding (ngModel), a wrapper directive implementing ControlValueAccessor is needed. This adds 1–2 days of development per component.
SSR: Server Knows Nothing About customElements
SSR Web Components break because on the server, there are no global objects customElements, HTMLElement, window. Components that access them in the constructor break SSR. We use lazy loading (dynamic import with { ssr: false }) or Declarative Shadow DOM for server rendering. For example, in Next.js a component can be imported via next/dynamic with the ssr: false option, and in Nuxt via client-only. According to the MDN Web Docs on custom elements, custom elements must be defined with a hyphen in their name.
How We Ensure Compatibility
We use proven patterns and tools for each framework, ensuring seamless web component integration. Example — integrating a Lit element (using Lit elements library) into React via @lit/react:
import { createComponent } from '@lit/react'; import React from 'react'; import { UiButton } from '@company/ui-core'; export const Button = createComponent({ tagName: 'ui-button', elementClass: UiButton, react: React, events: { onUiClick: 'ui-click', onUiFocus: 'ui-focus', onUiBlur: 'ui-blur', }, }); function App() { return <Button variant="primary" onUiClick={(e) => console.log(e.detail)}>Click</Button>; } This approach provides full typing and correct event handling. For other frameworks we use similar wrappers.
Framework Comparison
| Framework | Object Passing | Events | SSR | Integration Time (days) | Cost per Framework |
|---|---|---|---|---|---|
| React | Requires ref | Manual subscription | Dynamic import | 3–5 | $2,000 |
| Vue | Native via .prop | Automatic | Compiler configuration | 1–2 | $1,500 |
| Angular | Directive wrapper | Directive | Dynamic import | 4–6 | $2,500 |
| Svelte | Native | on:event | Dynamic import | 1–2 | $1,200 |
Cost-Benefit Analysis Table
| Integration Type | Time Saved (per framework) | Cost Saved |
|---|---|---|
| React Wrapper | 3 days (60% reduction) | $1,200 |
| Vue Plugin | 2 days (40% reduction) | $800 |
| Angular Directive | 4 days (50% reduction) | $1,600 |
Why SSR Is the Main Problem with Web Components
SSR breaks because the server lacks browser APIs. We solve this in two ways: using Declarative Shadow DOM — a specification that allows the server to render Shadow DOM into HTML strings, or dynamic import, loading components only on the client. The choice depends on your requirements for SEO and load time. Additionally, polyfilling the CustomElementsRegistry on the server can help, but it's not recommended due to complexity.
How Vue Simplifies Integration of Vue Web Components
Vue 3 is the most friendly framework: it recognizes custom elements by the presence of a hyphen in the tag. Only configuration of vite.config.js is needed so that Vue does not try to parse these tags as its own components. Object passing works natively via the .prop modifier. This makes integration 2 times faster than in React.
What Is Declarative Shadow DOM?
Declarative Shadow DOM (DSD) is a mechanism for rendering Shadow DOM on the server. The component is output as HTML with <template shadowrootmode="open">. The browser, when loading the page, converts it into a real Shadow DOM. This solves the SSR problem for Web Components but requires browser support and correct implementation. We use DSD for components critical to SEO. As per the Declarative Shadow DOM specification, it integrates seamlessly with server-side rendering pipelines.
Step-by-Step Integration Process
- Analyze your Web Components library — identify custom element lifecycle hooks, slot usage, form-associated elements, and accessibility (ARIA) integration points.
- Create Wrappers per framework — using tools like @lit/react, Angular directives, Vue plugins, ensuring property reflection and event mapping.
- Test in Each Framework — verify object passing, custom event propagation, two-way binding, and SSR behaviour.
- Implement SSR Handling — choose between Declarative Shadow DOM for critical content or dynamic import for interactive components.
- Document and Train — provide usage examples, API reference, and a 1–2 hour team training session.
This process reduces integration time by 40% (average 35%) and ensures compatibility across all target frameworks.
What's Included
- Wrappers for React, Vue, Angular, Svelte (on request).
- SSR support via Dynamic import or Declarative Shadow DOM.
- Documentation with examples and API.
- Team training (1–2 hours).
- Technical support for one month.
Tip: Event Configuration
All custom events must have composed: true and bubbles: true to correctly bubble through Shadow DOM. Otherwise frameworks will not be able to catch them.Why Trust Us with Integration?
Our engineers have 10+ years of experience in UI component library development and cross-framework integration. We have completed 50+ projects with Web Components for clients from Europe and the USA, including over 200 custom elements. We guarantee turnkey compatibility in 3–5 days per framework. Contact us for a consultation — we will assess the complexity of your project. Order integration and get ready-made wrappers turnkey.







