Add: Base UI support via --ui-library flag#45
Conversation
shadcn v4 supports Radix and Base UI as primitive libraries. Add --ui-library radix|base CLI arg and UI_LIBRARY env var to switch between them (React only, default: radix). - Add UiLibrary type and getUiLibrary() in framework.ts - Dynamic registry paths in axios.ts (bases/base/ vs new-york-v4/) - Handle demo naming (-example vs -demo suffix) - Base UI fallback component list - Base UI metadata from bases/base/ui/_registry.ts - Update directory structure handler for dynamic path - Document in README Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix empty catch block in getBlockCode (re-throw non-404 errors) - Update Base UI fallback list: 25 → 54 components - Memoize getFramework/getUiLibrary (eliminate log spam) - Warn when --ui-library used with non-React framework Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
hey @thisavoropaev thanks for the PR,will this also work with react native and the other implementations for shadcn ui? |
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
hey @Jpisnice !
Background: In December 2025, shadcn/ui added Base UI support for React as an alternative to Radix UI primitives (changelog). Note on Radix: While Radix is still supported, it's not actively maintained — the original team moved on to create Base UI. For new projects, Base UI is recommended. Base UI was specifically designed for easy migration from Radix. The registry structure reflects this:
For other frameworks: These have only one implementation each, so no If someone tries |
oh,okay..I will review and get back on this,if I have any doubts or need assistance |
Problem
Currently the MCP server only supports Radix UI primitives. However, shadcn/ui now supports both Radix and Base UI as primitive libraries. Users who prefer Base UI cannot use this MCP server effectively.
Solution
Add
--ui-library radix|baseCLI arg andUI_LIBRARYenv var to switch between primitive libraries (React only, default: radix).Changes
UiLibrarytype andgetUiLibrary()inframework.tsaxios.ts(bases/base/vsnew-york-v4/)-examplevs-demosuffix)Test Plan
npm run buildpassesnpm testpasses--ui-library radix(default)--ui-library base