Case study · npm library · NDA
A shared UI package teams build on
How I built one Angular package — layout, form controls, charts and bilingual support — that ten products are built on, starting as the foundation of the assessment platform rebuild.
- Role
- Author & maintainer
- Build
- Angular · ng-packagr · Angular CDK
- Docs
- Compodoc site, hosted on Firebase
- Release
- Published to npm by a build-and-publish script
The problem
Each product was building its own components and forms, so the same work was done twice and apps drifted apart in look and behaviour. When I led the assessment platform rebuild, the old UI had fixed widths, hard-coded colors and no real form controls.
The rebuild needed a foundation first: one place for layout, controls, charts and right-to-left support that any product could install.
The design
Split into small modules
Layout, controls, charts, utilities and product tours are separate modules. An app can import only the charts or only the controls, and the rest is left out of its bundle.
Real form controls
Eleven controls — input, select, datepicker with Hijri dates, phone, media upload, translation input and more — that plug straight into Angular forms, so validation works the same everywhere.
Layout through content projection
Header, menu, sidebar, drawer, modal and page containers that apps fill with their own content, instead of shared containers hard-coding each screen.
One chart builder
A single chart API on top of ECharts, plus mini gauge and circle charts — the front-end half of the standard chart format agreed with the back end.
Bilingual by default
Right-to-left and left-to-right switching, a translate pipe, and a translation input that can suggest translations with AI.
Built on Angular CDK
Menus, overlays, portals and tables use the CDK's tested primitives, while the look stays fully our own.
Product tours
Guided onboarding declared with a directive on any element, so each app adds tours without writing tour logic.
Outcome
- components
- 39
- form controls
- 11
- products built on it
- 10
Building something like this?
Say hello