Just subscribed? Check your inbox and click on the confirmation link to unlock the download.
What if you build your UI component library once and then reuse it in Angular and React? No copy-pasting, no rewriting code, and no chasing version mismatches between different frameworks and UI kits.
That’s exactly what we’re doing in this article. I’ll walk you through how to build a framework-agnostic component library, how to tie it directly to Figma, and how to use our own design tokens to customize everything. Then, we’ll put it to the test by reusing it in both an Angular and a React application. Same components, same look, one single source of truth.

Introduction
In my previous video, I argued why you shouldn't build a design system from scratch and why you should leverage an existing third-party system instead. In case you missed it, you can read it on medium, but here’s the short version.
It all comes down to resources. Building a component library from scratch is expensive. You need deep, specialized knowledge to build high-quality components like date pickers, complex data grids, and so on.
On top of that, you have to handle accessibility, keyboard navigation, focus management, theming, browser quirks, documentation, maintenance... the list goes on.
And all that effort for a problem the community has already solved. Think of components like bricks for a house. You wouldn’t make your own bricks, you’d build on top of them and focus on the architecture.
Every hour your team spends re-implementing a basic dropdown menu is an hour not spent on what makes your product yours: the user flows, the UX, the layouts, and the core logic.
So the recommendation is to take a mature third-party library and build your own theme on top.
Wrap it, don’t expose it
You probably have a few apps, and you want to reuse the same components between them or you’re constantly chasing versions between framework and UI library.
So why not use web components? They are a browser standard, well supported and they don’t care which framework you are using. There are some really good stable UI component libraries build on top of web components.

The core library is using Vaadin’s web components as the foundation, but wrapped each one in our own (ds-button, ds-text-field, ds-select, ds-form-layout) and exported only those. If Vaadin ships a breaking change, or you swap libraries in two years, you fix it in one place and your apps never notice.
A wrapped button looks roughly like this:
// src/button/ds-button.ts
import { Button } from '@vaadin/button';
export class OrgButton extends Button {
static get is() {
return 'org-button';
}
}
if (!customElements.get('org-button')) {
customElements.define('org-button', OrgButton);
}Angular integration
Using Web components in Angular is easy and it has excellent built-in support for them. Import the library in main.ts and add CUSTOM_ELEMENTS_SCHEMA to tell Angular not to freak out when it sees unknown tags.
import '@org/core-components';
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
@Component({
selector: 'app-profile',
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
templateUrl: './profile.component.html',
})
export class ProfileComponent {
firstName = '';
lastName = '';
country = 'no';
countries = [
{ label: 'Norway', value: 'no' },
{ label: 'Germany', value: 'de' },
{ label: 'Poland', value: 'pl' },
];
save() {
console.log({ firstName: this.firstName, lastName: this.lastName, country: this.country });
}
}Then just use them in your template file
<ds-form-layout>
<ds-text-field label="First name" [value]="firstName"
(value-changed)="firstName = $event.detail.value"></ds-text-field>
<ds-text-field label="Last name" [value]="lastName"
(value-changed)="lastName = $event.detail.value"></ds-text-field>
<ds-select label="Country" [items]="countries" [value]="country"
(value-changed)="country = $event.detail.value"></ds-select>
</ds-form-layout>
<ds-button (click)="save()">Save</ds-button>Theme it from Figma
While it works, it looks a bit naked. That’s expected, because we haven’t hooked up our design system yet.
A mature library usually ships matching Figma components, so designers and developers work from the same blueprint. Export the design tokens (colors, spacing, typography, radii), turn them into CSS variables, and ship one theme file. When the brand color changes, you run a sync instead of hunting through fifty files.
/* theme.css */
:root {
--lumo-primary-color: #5b3df5;
--lumo-primary-text-color: #5b3df5;
--lumo-border-radius-m: 8px;
--lumo-font-family: 'Inter', sans-serif;
}
/* theme.ts */
// Resolved by Vite at build time into a plain string (Lumo + overrides).
import themeCss from './theme.css?inline';
/** The theme as a CSS string, for apps that want to manage the stylesheet themselves. */
export { themeCss };
// inject the stylesheetFinally, import it into the Angular app, for example in styles.css:
@import '@org/core-components/theme';Refresh the page and there it is: the styles are applied, and everything uses our brand colors.
React takes about ten lines
Historically, web components in React meant props passed as attributes and a pile of boilerplate for events. There are many ways how you can integrate web components in React. The easiest I found is with a tiny utility called reactify-wc wraps each custom element as a real React component:
import reactifyWc from 'reactify-wc';
import '@org/core-components';
export const Button = reactifyWc('ds-button');
export const TextField = reactifyWc('ds-text-field');
export const Select = reactifyWc('ds-select');
export const FormLayout = reactifyWc('ds-form-layout');This wrapper stays very thin, with almost no maintenance. Then you just export them and they are ready to be used in React.
import { useState } from 'react';
import { FormLayout, Button, TextField } from '@org/react-components';
export function App() {
// rest of the code
return (
<main>
<h1>User Profile</h1>
<FormLayout>
<TextField
label="First name"
required
errorMessage="First name is required"
value={firstName}
onValueChanged={(e) => setFirstName(e.detail.value)}
/>
<TextField
label="Last name"
required
errorMessage="Last name is required"
value={lastName}
onValueChanged={(e) => setLastName(e.detail.value)}
/>
</FormLayout>
<Button onClick={handleSubmit}>Submit</Button>
</main>
}The result
One library, two frameworks, identical colors, spacing, and behavior. No duplicated components, no chasing version numbers, and more time for the actual product instead of re-implementing dropdowns.
