Radix UI adoption guide: Overview, examples, and alternatives
Tags: radixui, webdev
Published: 2024-05-01 17:03:57

**Written by [Nefe Emadamerho-Atori](https://blog.logrocket.com/author/nefejames/)✏️**

The Greek philosopher Heraclitus famously said that change is the only constant in life. I believe there’s another constant in a web developer’s life: the continued emergence of new UI libraries. As of this writing, frontend developers have over 40 UI libraries to choose from, with many more incoming. 

One of the major contenders in the frontend development space is Radix UI. It has quickly won the hearts and minds of many developers and has become a popular choice for building UI interfaces of websites and web applications. 

In this comprehensive guide, we will explore what Radix UI is, its features, why you should consider using it, and how it stacks up against other popular UI libraries. 

Let’s dive in!

* * *

## What is Radix UI?

[Radix UI](https://www.radix-ui.com/) is an open source headless UI component library for building design systems, websites, and web applications. It was created by the team at Modulz and [launched in November 2020](https://x.com/radix_ui/status/1332509274904416259?s=20). Radix UI is a React component library. However, creators in the community have developed Vue and Svelte versions, respectively tagged [Radix Vue](https://www.radix-vue.com/) and [Radix Svelte](https://radix-svelte.com/).

Being a headless UI library means that Radix UI doesn't come shipped with any styles. Instead, we can use our preferred styling solutions to style the headless UI components to fit our brand and website requirements. Tailwind CSS is a popular styling option for Radix components. 

Many developers use Radix UI because it simplifies development and simplifies maintenance. Radix UI also enjoys widespread adoption in the frontend space because of the fully accessible offers. Its components have been rigorously tested across various browsers and assistive technologies to ensure [full compliance](https://www.radix-ui.com/primitives/docs/overview/accessibility) with the [WAI-ARIA accessibility guidelines](https://www.w3.org/TR/wai-aria-1.2/). 

Radix UI is widely used for personal projects and large-scale applications. Organizations like Vercel, Supabase, and Linear use Radix UI for their design systems. As of this writing, Radix UI has a combined [20.3k GitHub stars across all its organization’s repos](https://github.com/radix-ui). 

Besides being used to create websites and applications, open-source creators also use Radix UI to build their UI component libraries. Some examples include:

*   [Shadcn UI](https://blog.logrocket.com/shadcn-ui-reusable-ui-component-collection/)
*   [cmdk](https://github.com/pacocoursey/cmdk)
*   [Wedges from Lemonsqueezy](https://github.com/lmsqueezy/wedges)
*   [Radix Vue](https://github.com/radix-vue/radix-vue)
*   [Radix Svelte](https://github.com/radix-svelte/radix-svelte)
*   [Rewinds Remix starter](https://github.com/mhaidarhanif/rewinds)

#### _Further reading:_

*   [Top utility-first CSS frameworks](https://blog.logrocket.com/top-utility-first-css-frameworks/)
*   [Exploring the shift from CSS-in-JS to headless UI libraries](https://blog.logrocket.com/exploring-shift-css-in-js-headless-ui-libraries/)

* * *

## Features of Radix UI

Radix UI offers many excellent features. Let’s explore some of the standout Radix UI features you should know.

### Radix Primitives

[Radix Primitives](https://www.radix-ui.com/primitives) is a collection of unstyled UI components that Radix UI provides. Radix Primitives focuses on a component’s behavior rather than its style. Instead, we are in control of styling Radix components to match our taste and project requirements. 

Radix UI only renders components with the markup they need to function properly. While other UI libraries ship their components with predefined styles, Radix UI takes a different approach and puts us in control of the design and appearance of its components from the onset. 

As of this writing, there are over 25 components in the Radix Primitives library, including Avatar, Popover, Select, Switch, and Tooltip. 

Radix Primitives features include:

*   **Out-of-the-box accessibility**: Radix UI components are fully accessible, are compatible with various devices and browsers, and support mouse, keyboard, and touch interactions
*   **Fully customizable and unstyled components**: We can use our preferred styling solution—Tailwind, Stitches, CSS, etc. — to customize the appearance of Radix components
*   Uncontrolled components
*   Fully-typed API

Here’s a code sample for the checkbox component:

```typescript
import * as Checkbox from '@radix-ui/react-checkbox';
import { CheckIcon } from '@radix-ui/react-icons';

const CheckboxDemo = () => (
  <form>
    <div>
      <Checkbox.Root defaultChecked id="c1">
        <Checkbox.Indicator>
          <CheckIcon />
        </Checkbox.Indicator>
      </Checkbox.Root>
      <label htmlFor="c1">
        Accept terms and conditions.
      </label>
    </div>
  </form>
);

export default CheckboxDemo;
```

Since Radix UI ships without styles, this is what we see in the browser: ![Unstyled Checkbox Created Using Radix Ui](https://blog.logrocket.com/wp-content/uploads/2024/04/img1-Unstyled-checkbox-Radix-UI.png) You can then style the component however you see fit.

### Radix Colors

Radix UI currently provides 396 colors via [Radix Colors, its color system](https://www.radix-ui.com/colors). An interesting thing about Radix UI that makes it different from other component libraries is that it doesn't just provide a color system, but also provides recommendations on how to best apply the colors. 

Radix UI does this by grouping the colors into the following categories:

*   Colors for backgrounds
*   Colors for interactive components
*   Colors for borders and separators
*   Solid colors
*   Colors for accessible texts

[The Radix UI documentation](https://www.radix-ui.com/colors/docs/palette-composition/understanding-the-scale#use-cases) provides more details on how to effectively apply the colors for different use cases. 

This unique approach to the color system provides helpful context to developers regarding when it’s best to use certain colors. Since not every developer may understand the principles of how to effectively apply colors when building user interfaces, this feature improves the developer experience. 

The image below shows the color grid with its categories and use cases highlighted: ![Radix Ui Color Grid Showing Categories And Use Cases Highlighted With A Red Box](https://blog.logrocket.com/wp-content/uploads/2024/04/img2-Radix-UI-color-grid-categories-use-cases-highlighted.png) Clicking on any color on the grid opens a modal that provides more details about the color and the best contexts for using it. The image below shows an example of this: ![Radix Ui Color Grid With An Open Modal After Selecting One Color To See More Details And Use Cases For The Color](https://blog.logrocket.com/wp-content/uploads/2024/04/img3-Radix-UI-color-grid-open-modal-color-providing-more-details-use-cases.png)

### Radix Themes

[Radix Themes](https://www.radix-ui.com/themes/docs/overview/getting-started) is Radix UI’s theming system. It allows us to customize the appearance of Radix UI components by defining custom values for accent colors, border radius, light and dark mode, and scale. The theming system also [provides component variants](https://www.radix-ui.com/themes/docs/theme/overview#variants), like `classic`, `solid`, and `soft`. 

To use Radix Themes in our application, we have to import the `Theme` provider from the `@radix-ui/themes` package and plug it into the application’s root. Here’s an example:

```typescript
import { Theme, ThemePanel } from '@radix-ui/themes';

export default function () {
  return (
    <Theme>
      <MyApp />
      <ThemePanel />
    </Theme>
  );
}
```

The `ThemePanel` component in the code above gives us a visual tool for creating custom themes that fit our needs. [Radix UI provides a theme playground](https://www.radix-ui.com/themes/playground) for exploring the theme panel: ![Radix Ui Theme Playground Providing Tools To Play With Theme Panel](https://blog.logrocket.com/wp-content/uploads/2024/04/img4-Radix-UI-theme-playground-exploring-theme-panel.png) Here’s a sample theme generated using the theme panel:

```typescript
<Theme appearance="dark" accentColor="sky" grayColor="gray" radius="none" scaling="110%">
```

### Radix Icons

Last but not least, [Radix Icons](https://www.radix-ui.com/icons). Similar to icon libraries like React Icons, Radix Icons is a collection of 15x15 SVG icons created by the Radix UI team. Some important things to know about Radix Icons are:

*   There are over 300 icons across different categories like typography, arrows, and logos
*   The width and height of the icons are hard hard-coded
*   All Radix Icons are available as React components.
*   Unlike React Icons, which provides a `size` prop for adjusting the size of its icons, Radix Icons does not. This means we’ll have to change each icon’s width and height properties ourselves via SVG code or CSS styles. This can be inefficient, particularly when working with several icons

#### _Further reading:_

*   [7 popular icon libraries you can use for free](https://blog.logrocket.com/7-popular-icon-libraries-you-can-use-for-free/)

* * *

## Why use Radix UI?

Let’s explore some reasons why we should consider Radix UI as our go-to UI library.

### Allows us to use our preferred styling options

Radix UI is a fully flexible and customizable UI library, allowing us to style components with our preferred styling solutions. This means we can use vanilla CSS, CSS frameworks, CSS modules, CSS preprocessor, or CSS-in-JS libraries to style Radix UI components.

#### _Further reading:_

*   [A deep dive into CSS Module](https://blog.logrocket.com/a-deep-dive-into-css-modules/)
*   [The definitive guide to SCSS](https://blog.logrocket.com/the-definitive-guide-to-scss/)
*   [Comparing the top zero-runtime CSS-in-JS libraries](https://blog.logrocket.com/comparing-top-zero-runtime-css-js-libraries/)

### Widely adopted and battle-tested

Developers are often wary of using a new technology because they’re concerned about how great the tool is. A great thing about Radix UI is that it is a widely adopted and battle-tested component library, making it a solid choice for everything from personal projects to enterprise applications. 

Even companies like Codesandbox, Linear, and Vercel use Radix UI to build their websites and internal applications. Besides that, Radix UI has served as the foundation for other popular UI libraries like Shadcn UI, which further illustrates how widely adopted and battle-tested it is.

### Supports server-side rendering

Radix UI offers support for server-side rendering (SSR), a technique that can greatly improve the initial load time and perceived performance of web applications. Rendering the initial HTML on the server and sending it to the client allows users to see the content faster, leading to a more seamless and engaging experience. 

As the demand for SSR frameworks like Next.js and Astro increases, Radix UI is a great tool to pair with these frameworks. Note that while Radix UI supports SSR out of the box, it relies on hydration to generate unique IDs for React versions lower than v18.

#### _Further reading:_

*   [A look at React hydration and pre-rendered HTML](https://blog.logrocket.com/react-hydration-pre-rendered-html/)
*   [Improve app performance with React server-side rendering](https://blog.logrocket.com/improve-app-performance-react-server-side-rendering/)
*   [Exploring React 18’s three new APIs](https://blog.logrocket.com/exploring-react-18-three-new-apis/)

### Supports incremental adoption

Unlike other UI libraries, Radix UI doesn’t bundle its components into a single package. Instead, we can install the specific component we need. This granular approach allows us to install and incorporate the required components selectively. 

This incremental adoption strategy minimizes Radix UI's impact on our codebase and allows us to integrate Radix UI at our own pace.

### Components are fully accessible

[Accessibility is an increasingly important topic](https://blog.logrocket.com/tag/accessibility/) in the frontend development space. More and more developers are recognizing and addressing the need to make frontend websites and web apps more accessible and provide equal access to all users. 

The good news for dev teams is that they can use Radix UI’s accessible components to build accessible websites more easily.

### Eliminates the need to override default styles

Since Radix UI doesn’t provide predefined styles, there aren’t any default styles to overwrite. Radix UI provides a clean slate, allowing us to define styles from scratch and create unique and consistent UI interfaces.

### Great for building unique websites

While component libraries like Chakra UI and Material UI are well established and a great choice for building websites, projects built with these libraries tend to have a similar appearance across the board since they rely on the same components and styles. 

However, Radix UI’s components ship without styles, making it a great choice when building websites with unique brand designs and requirements. You can easily customize your website and make it unique so that it stands out among others.

* * *

## Pros of using Radix UI

Radix UI provides a variety of advantages in frontend development, many of which we’ve touched on already. Here are a few reasons why you should use Radix UI:

*   **Provides unique components**: Radix UI offers several unique utilities that can greatly enhance the development experience. An example is the [Visually Hidden utility component](https://www.radix-ui.com/primitives/docs/utilities/visually-hidden) that allows us to hide components visually while keeping them accessible to screen readers
*   **Shows how to use colors effectively**: Besides providing a great color palette, Radix UI also offers robust guidance on effectively utilizing the colors, including how to apply these colors to different components and elements. This can greatly benefit developers who may struggle with color theory or maintaining consistent color schemes across their applications. The guidelines can also help in improving the overall accessibility and usability of the application
*   **Enhances web accessibility**: Ensuring accessibility is a core principle of Radix UI, and its components are designed to enhance the accessibility of web applications. The components adhere to the latest Web Content Accessibility Guidelines (WCAG) and WAI-ARIA standards and best practices. This ensures that components are properly labeled and structured for screen readers and other assistive technologies
*   **Lightweight**: One of the key advantages of using Radix UI is its lightweight nature. It is designed to provide essential functionality without bloating the application's bundle size, ensuring faster load times and better performance, especially on low-end devices or slow network connections
*   **Promotes brand consistency**: Radix UI’s unstyled nature means that you don’t need to spend valuable time overriding default styles or battling against conflicting styles from multiple sources. Instead, you can focus your efforts on crafting a cohesive design language that aligns perfectly with your brand's visual identity and design system
*   **Offers pre-styled examples and code snippets for faster development**: Radix UI offers pre-styled examples and code snippets for every component it offers. We can easily copy and edit the code snippets into our projects. This feature can significantly accelerate the development process, as we don’t need to start building or integrating components from scratch

Another great thing is that Radix UI provides code snippets and examples for three styling options— vanilla CSS, Tailwind CSS, and Stitches. This approach caters to developers with diverse preferences and ensures that everyone can find a styling solution that aligns with their existing workflow or team conventions.

#### _Further reading:_

*   [Building a color palette with CSS: 3 methods](https://blog.logrocket.com/building-color-palette-css/)
*   [Stitches: A modern, server-rendered CSS-in-JS library](https://blog.logrocket.com/stitches-server-rendered-css-in-js/)

* * *

## Cons of using Radix UI

We’ve been discussing what makes Radix UI great, but it’s only fair to also evaluate its drawbacks. Here are some disadvantages of using Radix UI.

### Provides limited components

Being a relatively new component library, Radix UI does not offer as many components as other more established libraries. Here’s how Radix UI stacks up against other component libraries in terms of the number of components they provide:

*   Radix UI: 28
*   MUI: 50
*   Ant Design: 66
*   React Bootstrap: 25
*   Semantic UI: 38
*   Blueprint: 67
*   Fluent 2 by Microsoft: 36
*   React Suite: 64
*   Grommet: 73
*   Chakra UI: 53
*   Theme UI: 37
*   Mantine UI: 114
*   NextUI: 38

Note that the above data is only valid as of this writing, as UI libraries are regularly updated with new components.

### Radix icons have a fixed width

Interestingly, the icons in the Radix Icons package all have a fixed width and height of 15x15 pixels. While this is not a major issue, as we can adjust those values with CSS, it is a deviation from how icon libraries are expected to function. 

For example, libraries like React Icons and Font Awesome icons allow us to adjust the size of their icons via special classes or props:

```typescript
//adjusting size of some Font Awesome icons with 'fa-sm' and 'fa-lg' classes 
<i class="fa-solid fa-coffee fa-sm"></i>
<i class="fa-solid fa-coffee fa-lg"></i>

//adjusting size of a React Icons icon with the 'size' prop
import { BsBroadcastPin } from "react-icons/bs";

function App() {
  return (
    <>
      <BsBroadcastPin size={14} />
    </>
  );
}

//for Radix Icons, we have to use CSS to change its size
import { ImageIcon } from "@radix-ui/react-icons";

function App() {
  return (
    <>
      <ImageIcon />
    </>
  );
}

svg {
  width: 40px;
  height: 40px;
}
```

### Components are unstyled

While components shipping without styles is a benefit and selling point of headless UI libraries, it can also be a disadvantage. Depending on the resources available and project deadlines, using a headless component library can be a disadvantage for dev teams. 

For example, Radix UI may not be the best fit for developers with limited time to build and launch a product since they have to define component styles from scratch.

### Increased complexity

An advantage of styled UI libraries like Chakra UI and MUI is that they provide styles for their components. This feature can make creating websites easier for many developers, particularly those without an eye for design. 

However, since headless libraries ship without styles, that's extra work for us since we have to define styles for the components we need. Radix UI offers tools to counter this potential drawback, such as the color usage guidelines we explored earlier, but depending on your team’s strengths and priorities, it may not be ideal for your needs.

#### _Further reading:_

*   [Chakra UI adoption guide](https://blog.logrocket.com/chakra-ui-adoption-guide/)
*   [Getting started with MUI and Next.js](https://blog.logrocket.com/getting-started-mui-next-js/)

* * *

## Getting started with Radix UI

Follow these steps to get started with Radix UI. First, install the Radix Themes package:

```bash
npm install @radix-ui/themes
```

Next, import the global CSS file:

```typescript
import '@radix-ui/themes/styles.css';
```

Then, wrap the React application’s root component with Radix UI’s theme component inside the `body` tag:

```typescript
import { Theme } from '@radix-ui/themes';

export default function Root () {
  return (
    <html>
      <body>
        <Theme>
          <MyApp />
        </Theme>
      </body>
    </html>
  );
}
```

* * *

## Use cases for Radix UI

Radix UI’s use cases and applications are many and varied. A few common ones include:

*   **Building design systems**: The accessibility, extensibility, and composability of Radix UI’s theming system make it a top choice for building design systems. Companies like Vercel and Codesandbox built their design systems with Radix UI
*   **Creating websites and applications**: Radix UI is compatible with several styling methods, meaning we can use it to build websites and web applications.
*   **Building UI libraries**: As we explored earlier in the article, many open-source builders use Radix UI to build their own UI component libraries, with Shadcn UI being a popular example

You can also review a list of real teams and businesses using Radix UI in their websites and applications below. 

[CodeSandbox](https://www.radix-ui.com/primitives/case-studies/codesandbox) uses Radix Primitives for its design system components, thereby improving the accessibility of their components: ![Code Sandbox Use Case For Radix Ui](https://blog.logrocket.com/wp-content/uploads/2024/04/img5-Code-Sandbox-Radix-UI.png) [Liveblocks](https://www.radix-ui.com/primitives/case-studies/liveblocks) uses Radix Primitives and Tailwind CSS to create custom UI components. Liveblocks then uses these custom components for their documentation site, marketing site, and product dashboard: ![Liveblocks Use Case For Radix Ui](https://blog.logrocket.com/wp-content/uploads/2024/04/img6-Liveblocks-Radix-UI.png) [Vercel](https://www.radix-ui.com/primitives/case-studies/vercel)’s product team uses Radix Primitives for its design system, internal applications, and marketing websites: ![Vercel Use Case For Radix Ui](https://blog.logrocket.com/wp-content/uploads/2024/04/img7-Vercel-Radix-UI.png) [Supabase](https://www.radix-ui.com/primitives/case-studies/supabase) uses Radix Primitives for its design system called Supabase UI: ![Supabase Use Case For Radix Ui](https://blog.logrocket.com/wp-content/uploads/2024/04/img8-Supabase-Radix-UI.png) [Linear](https://www.radix-ui.com/primitives/case-studies/linear) uses Radix Primitives for Orbiter—their design system. Radix Primitives has helped Linear improve their accessibility and productivity while also reducing the complexity of their codebase. ![Linear Orbiter Use Case For Radix Ui](https://blog.logrocket.com/wp-content/uploads/2024/04/img9-Linear-Orbiter-Radix-UI.png) Explore [Radix UI’s case studies](https://www.radix-ui.com/primitives/case-studies) to see other brands that use Radix UI for their websites.

#### _Further reading:_

*   [Building a design system with Radix](https://blog.logrocket.com/building-design-system-radix/)

* * *

## Radix UI vs. other headless UI alternatives

While Radix UI has quickly become a top choice in the headless UI space, it's not the only option available. The table below gives a brief overview of how Radix UI stacks up against other headless UI solutions:

<table>

<thead>

<tr>

<th></th>

<th>Radix UI</th>

<th>Headless UI by Tailwind CSS</th>

<th>React Aria</th>

<th>Ariakit</th>

<th>Base UI by MUI</th>

<th>Downshift</th>

</tr>

</thead>

<tbody>

<tr>

<td>GitHub stars</td>

<td>20.3k</td>

<td>23.7k</td>

<td>11.1k</td>

<td>7.5k</td>

<td>45</td>

<td>11.8k</td>

</tr>

<tr>

<td>Bundle size (minified + gzipped)</td>

<td>248b</td>

<td>33.8kb</td>

<td>167.6kb</td>

<td>38.7kb</td>

<td>48.7kb</td>

<td>14.6kb</td>

</tr>

<tr>

<td>Number of components (as of this writing)</td>

<td>28</td>

<td>10</td>

<td>37</td>

<td>25</td>

<td>20</td>

<td>One (called Downshift) along with three hooks</td>

</tr>

<tr>

<td>Online playground</td>

<td>✅</td>

<td>❌</td>

<td>❌</td>

<td>❌</td>

<td>❌</td>

<td>❌</td>

</tr>

<tr>

<td>Documentation</td>

<td>Robust and detailed documentation</td>

<td>Robust and detailed documentation</td>

<td>Robust and detailed documentation</td>

<td>Robust and detailed documentation</td>

<td>Robust and detailed documentation</td>

<td>Sparse documentation</td>

</tr>

<tr>

<td>WAI-ARIA accessible components</td>

<td>✅</td>

<td>✅</td>

<td>✅</td>

<td>✅</td>

<td>✅</td>

<td>✅</td>

</tr>

</tbody>

</table>

You can use this comparison table to help you evaluate Radix UI for use in your next project.

* * *

## Conclusion

Throughout this article, we’ve explored Radix UI’s features, its pros and cons, use cases, and how it compares against other headless UI libraries. We also walked through the steps of integrating Radix UI into a React application and explored some websites and teams using Radix UI. 

Radix UI is quickly rising in popularity and has become a go-to solution for building design systems and websites. Overall, it is an excellent styling solution for creating modern applications. 

If you’d like to start using Radix UI, great! Here are some Radix UI starter templates you can use to speed up the development process:

*   [Precedent Next.js starter from Vercel](https://vercel.com/templates/next.js/precedent)
*   [next-enterprise](https://github.com/Blazity/next-enterprise)
*   [chadnext quick start template](https://github.com/moinulmoin/chadnext)

Lastly, explore these resources to learn even more about Radix UI:

*   [Radix UI documentation](https://www.radix-ui.com/themes/docs/overview/getting-started)
*   [Sam Selikoff’s Radix UI YouTube playlist](https://www.youtube.com/playlist?list=PLlNdnoKwDZdwANQoaakE8-kYMyKFOETlo)

---

##Get set up with LogRocket's modern error tracking in minutes:

1. Visit https://logrocket.com/signup/ to get an app ID.
2. Install LogRocket via NPM or script tag. `LogRocket.init()` must be called client-side, not server-side.

NPM:
```bash
$ npm i --save logrocket 

// Code:

import LogRocket from 'logrocket'; 
LogRocket.init('app/id');
```
Script Tag:
```javascript
Add to your HTML:

<script src="https://cdn.lr-ingest.com/LogRocket.min.js"></script>
<script>window.LogRocket && window.LogRocket.init('app/id');</script>
```

3.(Optional) Install plugins for deeper integrations with your stack:
*   Redux middleware
*   ngrx middleware
*   Vuex plugin

[Get started now](https://lp.logrocket.com/blg/signup)