# Migrate Radix To Base > Migrates React projects and components from Radix UI to Base UI. Use when asked to migrate from radix, move to base-ui, convert radix primitives, or switch a shadcn project's base library. Handles single components ("migrate accordion") and whole projects. Source: https://skillsagentes.com/skills/shadcn/ui/migrate-radix-to-base Repository: https://github.com/shadcn-ui/ui Author: shadcn-ui License: MIT Updated: el mes pasado Context cost: 64 tok installed, 2.3k tok once triggered, 44.2k tok with every bundled file Bundle: 10 files, 173 KB Permissions requested: none declared ## Install ```bash npx -y skills add shadcn-ui/ui --skill migrate-radix-to-base --agent claude-code ``` ## What it does - Migra wrappers de shadcn, composiciones radix hechas a mano y su código consumidor de @radix-ui a @base-ui/react - Usa el CLI de shadcn como 'golden pair' para reconstruir componentes stock antes de recurrir a una transformación manual - Aplica tablas de props por familia (overlays, menus, form-controls, disclosure, display-misc) y class-mapping.md para reescrituras - Genera un reporte por componente en .migration/.md con cambios, comportamientos alterados y checklist de QA manual - Detecta y respeta librerías no-radix (cmdk, vaul, sonner, input-otp, react-day-picker, recharts) dejándolas intactas ## Use it when - Se pide migrar de radix, pasar a base-ui, convertir primitivas radix, o cambiar la librería base de un proyecto shadcn - Migrar un componente individual (ej. 'migrate accordion') o un proyecto shadcn completo - El proyecto mezcla estados: algunos componentes ya en base, otros aún en radix, y hay que continuar el trabajo ## What triggers it - "Migra el componente accordion de radix a base-ui" - "Convierte todo el proyecto de radix-ui a base-ui" - "Pasa el dropdown-menu y el alert-dialog a @base-ui/react" - "¿Qué componentes quedan pendientes de migrar de radix?" ## Before you install - Requiere un árbol git limpio, trabajar en una rama, y detectar el gestor de paquetes del proyecto (pnpm/bun/yarn/npm) antes de instalar @base-ui/react. ## Files - SKILL.md — 9 KB - class-mapping.md — 3 KB - consumer-props.md — 4 KB - disclosure.md — 20 KB - display-misc.md — 25 KB - form-controls.md — 29 KB - menus.md — 32 KB - overlays.md — 31 KB - universal-patterns.md — 14 KB - wrapper-shapes.md — 5 KB ## SKILL.md Reproduced verbatim from shadcn-ui/ui under MIT. This section is the upstream document and is in English. # Radix UI -> Base UI migration You migrate shadcn wrappers, hand-rolled radix compositions, and their consumers to `@base-ui/react`, keeping the project buildable at every step. Be precise; never guess a mapping. When a prop or part is not in these reference files, check `node_modules/@base-ui/react/**/*.d.ts` before transforming, and record gaps in the report. ## Preflight (always) 1. `npx shadcn@latest info --json` (or the project's runner): gives the current base, STYLE (e.g. `radix-lyra`), tailwind version, aliases, installed components, and package manager. Trust it over inference. 2. Detect the package manager (packageManager field / lockfile: pnpm-lock.yaml, bun.lock, yarn.lock, package-lock.json) and use IT for every install. Never leave a stale lockfile. 3. Require a clean git tree; work on a branch; one commit per component. 4. Baseline check BEFORE touching dependencies: run the project's typecheck/build so pre-existing failures are never attributed to you. 5. Install `@base-ui/react` alongside radix. Radix packages are removed only after the LAST component is migrated (both coexist fine). ## Strategy: golden pair first, transformation engine second - **Golden pair via the CLI (preferred).** If the project is shadcn with a known style (`radix-