secondsky/claude-skills / plugins/base-ui-react/skills/base-ui-react
base-ui-react
VerifiedMUI Base UI unstyled React components with Floating UI. Use for accessible components, Radix UI migration, render props API, or encountering positioning, popup, v1.0 rc / pre-GA issues.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.3 KB |
| assets/example-template.txt | markdown | 416 B |
| references/example-reference.md | markdown | 760 B |
| references/migration-from-radix.md | markdown | 6.7 KB |
| references/setup-guide.md | markdown | 1.9 KB |
| scripts/check-base-ui-version.shexecutable | script | 1.6 KB |
| scripts/example-script.shexecutable | script | 302 B |
| scripts/migrate-radix-component.shexecutable | script | 3.3 KB |
| templates/Accordion.tsx | other | 13.7 KB |
| templates/Dialog.tsx | other | 5.0 KB |
| templates/NumberField.tsx | other | 11.2 KB |
| templates/Popover.tsx | other | 8.6 KB |
| templates/Select.tsx | other | 8.4 KB |
| templates/Tooltip.tsx | other | 9.4 KB |
| templates/migration-example.tsx | other | 9.9 KB |
scripts/migrate-radix-component.sh
View on GitHub#!/bin/bash
# Automated Radix UI → Base UI migration helper
# WARNING: This script modifies files. Commit your changes first!
set -e
if [ $# -eq 0 ]; then
echo "Usage: $0 <file.tsx>"
echo ""
echo "Example:"
echo " $0 src/components/Dialog.tsx"
echo ""
echo "⚠️ WARNING: This script modifies files. Commit your changes first!"
exit 1
fi
FILE="$1"
if [ ! -f "$FILE" ]; then
echo "❌ Error: File not found: $FILE"
exit 1
fi
echo "🔄 Migrating $FILE from Radix UI to Base UI..."
echo ""
# Create backup. If a previous .radix-backup exists (script was run before),
# preserve it as .radix-backup.<timestamp> BEFORE taking the new backup so
# the truly-original pre-migration state survives multiple runs. This makes
# the script idempotent: re-runs no longer overwrite the original snapshot.
BACKUP="${FILE}.radix-backup"
if [ -f "$BACKUP" ]; then
TS="$(date +%Y%m%d%H%M%S)"
PREV_BACKUP="${BACKUP}.${TS}"
mv "$BACKUP" "$PREV_BACKUP"
echo "ℹ️ Existing backup moved aside: $PREV_BACKUP"
fi
cp "$FILE" "$BACKUP"
echo "✅ Created backup: $BACKUP"
# Perform migrations
echo "🔧 Applying transformations..."
# 1. Update imports
sed -i 's/import \* as Dialog from "@radix-ui\/react-dialog"/import { Dialog } from "@base-ui-components\/react\/dialog"/' "$FILE"
sed -i 's/import \* as Popover from "@radix-ui\/react-popover"/import { Popover } from "@base-ui-components\/react\/popover"/' "$FILE"
sed -i 's/import \* as Select from "@radix-ui\/react-select"/import { Select } from "@base-ui-components\/react\/select"/' "$FILE"
sed -i 's/import \* as Tooltip from "@radix-ui\/react-tooltip"/import { Tooltip } from "@base-ui-components\/react\/tooltip"/' "$FILE"
sed -i 's/import \* as Accordion from "@radix-ui\/react-accordion"/import { Accordion } from "@base-ui-components\/react\/accordion"/' "$FILE"
# 2. Replace component names
sed -i 's/\.Content\b/.Popup/g' "$FILE"
sed -i 's/\.Overlay\b/.Backdrop/g' "$FILE"
# 3. Replace props
sed -i 's/\balign="/alignment="/g' "$FILE"
# 4. Add TODO markers for manual fixes
echo ""
echo "⚠️ Manual fixes required:"
echo ""
echo "1. Replace asChild with render props:"
echo " <Trigger asChild><button /></Trigger>"
echo " → <Trigger render={(props) => <button {...props} />} />"
echo ""
echo "2. Add Positioner wrapper for Select, Popover, Tooltip:"
echo " <Portal><Popup /></Portal>"
echo " → <Positioner side=\"top\"><Portal><Popup /></Portal></Positioner>"
echo ""
echo "3. Make Portal explicit if not already"
echo ""
echo "4. Ensure all render props spread {...props}"
echo ""
# Add TODO comment at top of file (only if not already present, so the script
# is idempotent across re-runs and doesn't stack duplicate markers).
if ! grep -q '^// TODO: Complete Base UI migration' "$FILE" 2>/dev/null; then
sed -i '1i // TODO: Complete Base UI migration - check render props, Positioner wrappers, and Portal usage' "$FILE"
fi
echo "✅ Automatic transformations complete!"
echo ""
echo "📝 Next steps:"
echo " 1. Review changes: git diff $FILE"
echo " 2. Manually fix asChild → render props"
echo " 3. Add Positioner wrappers where needed"
echo " 4. Test thoroughly"
echo " 5. Remove TODO comment when done"
echo ""
echo "📚 See references/migration-from-radix.md for complete guide"
echo ""
echo "To restore backup:"
echo " mv $BACKUP $FILE"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |