# base-vs-radix

base-vs-radix — an IDE rule that clarifies API differences between shadcn's base components and their Radix counterparts. Covers composition, Select options, value types, and prop naming across multiple components.

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 7523 repo stars
- Author: Devin-AXIS
- License: LicenseRef-Proprietary · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Devin-AXIS/iPolloWork/tree/HEAD/.opencode/skills/shadcn/rules/base-vs-radix.md
- Updated: 2026-10-29
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/base-vs-radix

## What it does

When working with shadcn across different component implementations, base and Radix versions use different APIs. This rule documents the gaps: Radix uses `asChild` where base uses `render`; Select in base requires an items array and supports multiple values and objects, while Radix is single-select with strings only; ToggleGroup and Accordion treat defaultValue as an array in base but a string in Radix; Slider accepts a plain number in base but always an array in Radix.

When a trigger's `render` prop points to a non-button element, base requires `nativeButton={false}`. Select in base uses `alignItemWithTrigger` instead of `position` for layout. Understanding these patterns prevents runtime errors and keeps code coherent across mixed component usage.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/rules/base-vs-radix.md` — The paths frontmatter field limits the files

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### Cursor

**Manually: put the files in place**
- File: `.cursor/rules/base-vs-radix.mdc` — Frontmatter: description, globs, alwaysApply

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/base-vs-radix.instructions.md` — The applyTo field sets which files it applies to

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/base-vs-radix.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/base-vs-radix.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/Devin-AXIS/iPolloWork/tree/HEAD/.opencode/skills/shadcn/rules/base-vs-radix.md

## When to use it
- choose asChild or render based on component implementation
- configure Select items, placeholder, and positioning correctly in base
- manage ToggleGroup value as array or string depending on version
- pass Slider defaultValue as number or array without type errors
- add nativeButton={false} when rendering trigger or button as link or custom element

## Example prompts
- Should I use asChild or render to wrap a Button inside DialogTrigger?
- Does Select in base need an items array, or can I use inline SelectItem children?
- Why does defaultValue in ToggleGroup work differently between base and Radix?

## Similar
- [migrate-radix-to-base](https://affpapa.org/en/nevibecode/skills/migrate-radix-to-base.md) — skill · 37800 installs
- [shadcn](https://affpapa.org/en/nevibecode/skills/pymodel-shadcn.md) — skill · 599 installs
- [radix-ui-design-system](https://affpapa.org/en/nevibecode/skills/radix-ui-design-system.md) — skill · 1400 installs
- [base-ui-migrator](https://affpapa.org/en/nevibecode/skills/base-ui-migrator.md) — skill · 144 installs
- [affectUI](https://affpapa.org/en/nevibecode/mcp/affectui.md) — MCP server · ★ 917 repo stars
- [UI Beats](https://affpapa.org/en/nevibecode/mcp/ui-beats.md) — MCP server · ★ 235 repo stars

From the same set: [devin-axis/ipollowork](https://affpapa.org/en/nevibecode/by/devin-axis/ipollowork.md) — 42 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
