All posts

Don’t Build Your Own UI Primitives

Learn why Base UI and similar frameworks offer a better foundation than custom UI primitives, saving time while improving accessibility and consistency.

Engineering

Building a dropdown, dialog, tooltip or select component can look deceptively simple. Then come keyboard navigation, focus management, screen-reader support, touch interactions, positioning and a long list of browser quirks.

That’s why frameworks such as Base UI are usually a better starting point than building everything yourself.

A mature component framework gives you the difficult behaviour out of the box while leaving styling and composition in your hands. Your team can focus on what makes the product unique instead of repeatedly solving accessibility and interaction problems that already have well-tested solutions.

You also gain consistency. Components share predictable APIs and behaviour, making the interface easier to develop, test and maintain. Improvements and bug fixes can benefit the entire product rather than being scattered across custom implementations.

Building from scratch can make sense when your interaction model is genuinely unusual or existing libraries cannot meet a hard requirement. For most applications, however, custom primitives create extra work without creating extra value.

Use Base UI-or a similar headless framework-as the foundation. Customise the experience, not the fundamentals.