Universal Design System
Architecting a framework-agnostic component library with StencilJS and a custom React compatibility bridge for cross-platform consistency.
Client
Global FinTech Provider
Role
Lead Design Systems Engineer
Duration
8 months
The Challenge
Large enterprises often suffer from "UI Drift," where different teams build the same button in React, Angular, and Vue, leading to inconsistent branding and wasted effort. I was brought in to solve this by building a single "Source of Truth": a high-performance UI library that works anywhere.
The StencilJS Foundation
I chose StencilJS to build standard-compliant Web Components. By leveraging the Virtual DOM and TypeScript, I created a suite of components that are natively understood by the browser. This eliminated the need for a massive framework runtime, drastically reducing the initial load time for the client's micro-frontends.
The React Compatibility Bridge
While Web Components are universal, their integration with React’s synthetic event system can sometimes be clunky (especially with props and custom events). I engineered a custom compatibility bridge that:
- Auto-generated React Wrappers: Using Stencil's output targets, I ensured that React developers could import components as standard JSX elements with full IntelliSense and Type safety.
- Prop-Syncing: Created a seamless synchronization layer to ensure that complex data structures passed to the Web Components remained reactive within the React lifecycle.
Single Codebase, Infinite Scale
The core philosophy was "Write once, run everywhere." Whether the internal team was building a legacy dashboard in jQuery or a modern SPA in React, they pulled from the same NPM package.
Technical Highlights
- Shadow DOM Architecture: Guaranteed CSS encapsulation so that "leaky" legacy styles from older parts of the platform wouldn't break the new UI components.
- Design Tokens: Implemented a robust theme engine using CSS Variables, allowing the marketing team to update the entire brand palette across all frameworks by changing a single JSON file.
The Result
We achieved a 95% code reuse rate across three different departments. The internal development time for new features dropped significantly because engineers no longer had to "re-invent" the UI—they simply assembled it from the library, knowing that accessibility (A11y) and performance were already baked into the core.
Impact Metrics
-
95%
Code Reuse
-
-40%
Bundle Size Reduc.
-
5+
Frameworks Supported