Skip to content

shadcn/ui Base UI vs Radix: which primitive library to pick

Compare Radix UI (asChild, data-state) and Base UI (render prop, data-open) in shadcn/ui: composition, Tailwind v4 animations, registries, and when to pick each.

Updated 3 December 2026Tested with
  • shadcn 4.23.0
  • Tailwind CSS 4.3.5
  • Vite 8
  • React 19.3

Since 2026, shadcn init lets you choose between Radix UI and Base UI for interactive primitives (dialogs, menus, selects, popovers, accordions). Both generate components with the same Tailwind CSS v4 styling and copy the files into your repo. Pick Radix if you want the widest third-party block and tutorial compatibility today; pick Base UI if you are starting a new React 19 app and want render props instead of asChild.

Side-by-side comparison

AspectRadix UIBase UI
Composition APIasChild prop (Slot merging)render prop (render={<a href="..." />})
Open/closed attributedata-state="open" / "closed"data-open / data-closed (boolean attributes)
Package layoutUnified radix-ui package (or per-primitive @radix-ui/react-*)Single @base-ui/react package
Combobox & AutocompleteBuilt on cmdk + PopoverFirst-class primitive
Third-party registriesSupported by almost every existing registryGrowing; check before copying blocks
MaintainerWorkOSMUI (former Radix & Floating UI authors)

The main code difference: asChild vs render

When you want a trigger or button to render as a Next.js <Link> or an <a> tag, Radix uses asChild and merges props onto the single child element:

radix-example.tsxTSX
<DialogTrigger asChild>  <Button variant="outline">Open settings</Button></DialogTrigger>

Base UI replaces asChild with a render prop. It avoids React's cloneElement quirks and makes TypeScript types stricter:

base-ui-example.tsxTSX
<DialogTrigger render={<Button variant="outline" />}>  Open settings</DialogTrigger>

Why Tailwind v4 animations work with both

Radix sets data-state="open", whereas Base UI sets a bare data-open attribute. Both work with the same shadcn/ui classes because @import "shadcn/tailwind.css"; maps data-open: to both selectors. If animations stop working after switching, check shadcn/ui animations not working on Tailwind v4.

Which one should you choose?

  • Pick Radix UI if you install blocks from community registries, follow existing shadcn/ui tutorials, or maintain an app that already uses asChild. Every themes.dev block and component runs on Radix out of the box.
  • Pick Base UI if you are starting greenfield on React 19, rely heavily on comboboxes/number fields/portals, and prefer explicit render props over asChild.

Questions

Can I switch an existing project from Radix to Base UI?

Not automatically. Because every asChild usage becomes a render prop and some subcomponent names differ, switching means re-installing your components/ui/ files and updating call sites. Use npx shadcn@latest add --dry-run first; see how to update shadcn/ui components.

Is one faster or smaller than the other?

In practice the difference is a few kilobytes gzipped once tree-shaken. Pick based on API ergonomics and ecosystem compatibility, not micro-benchmarks. For the full architecture overview, read shadcn/ui explained.

Was this page helpful?

Still stuck? We answer every message ourselves. Write to us

Building with shadcn/ui and Tailwind CSS v4?

Install 188 free blocks and components with the shadcn CLI (no account), preview them in your own brand in Studio, or get all 1,570 blocks and every theme in UI Pro (€199 once).

Use it with

This page is built from UI Pro parts: the docs article block (docs-quernly) with the code, terminal, install command, steps, contents and feedback components, included in UI Pro.