Introduction
Building a production-ready design system is one of the most impactful investments a team can make. When done right, it accelerates development, enforces consistency, and makes accessibility a default rather than an afterthought. In this article, we explore how combining Radix UI primitives with Tailwind CSS v4 creates a powerful foundation for exactly that.
Why Radix UI Primitives
Radix UI provides unstyled, accessible primitives for the hardest parts of the UI: dialogs, dropdowns, tooltips, and more. These primitives handle the behavior — including focus trapping, keyboard navigation, screen reader announcements, and ARIA attributes — so you can focus on the look.
"The hardest part of building accessible UI is not knowing what you don't know. Radix solves this by making accessibility the default, not the exception."
— Ninna UI Team
WAI-ARIA built-in
Every Radix primitive ships with the correct WAI-ARIA roles, states, and properties. A Dialog automatically manages aria-modal, aria-labelledby, and aria-describedby. A DropdownMenu manages aria-expanded and synchronizes focus when opened or closed.
Keyboard navigation
Arrow key navigation, Home/End keys, typeahead search in menus — all handled without a single line of custom event listener code. This matters because keyboard navigation is the primary interface for many users with motor disabilities.
Tailwind CSS v4 Integration
Tailwind CSS v4 introduces a CSS-first configuration model that is a perfect match for component libraries. The @theme directive lets you define design tokens in CSS, and @source lets libraries safeload their own utility classes without requiring the consumer to configure anything.
@import "tailwindcss";
@source "../node_modules/@ninna-ui/*/dist/**/*.js";
@theme {
--color-primary: oklch(60% 0.2 260);
--color-primary-content: oklch(98% 0.01 260);
}Zero-Runtime Theming
Unlike CSS-in-JS solutions, Ninna UI themes are pure CSS files. Switching themes requires nothing more than swapping a <link> tag. No JavaScript bundles. No hydration cost. No flash of unstyled content. The browser does all the work.
Conclusion
The combination of Radix UI primitives, Tailwind CSS v4, and CSS custom properties gives you the trifecta: accessibility by default, styling flexibility, and zero runtime overhead. This is the stack we chose for Ninna UI, and we haven't looked back.
Alex Rivera
Lead Engineer, Ninna UI
Full-stack developer with 8 years of experience building design systems and component libraries for startups and Fortune 500 companies.