首页/前端开发/heroui-migration
H

heroui-migration

by @heroui-incv1.0.0
4.4(15)

自动迁移 HeroUI v2 应用到 v3,处理复合组件重构、Provider 移除、Tailwind v4 升级等破坏性更改

reacttailwind-cssui-componentsmigrationGitHub
安装方式
npx skills add heroui-inc/heroui --skill heroui-migration
compare_arrows

Before / After 效果对比

1
使用前

手动逐个检查组件使用方式,重构 Compound Components API,移除 Provider 包装,升级 Tailwind 配置,整个应用迁移需要数天时间,容易遗漏破坏性更改导致运行时错误

使用后

自动扫描代码库识别 HeroUI v2 使用模式,批量生成 v3 兼容代码,智能处理组件嵌套和样式迁移,几小时内完成整个应用的升级,附带迁移报告和风险评估

description SKILL.md

heroui-migration

HeroUI v2 to v3 Migration Guide

This skill helps agents migrate HeroUI v2 applications to v3. HeroUI v3 introduces breaking changes: compound components, no Provider, Tailwind v4, and removed hooks.

Installation

curl -fsSL https://heroui.com/install | bash -s heroui-migration

CRITICAL: Always Fetch Migration Docs Before Applying

Do NOT assume v2 patterns work in v3. Always fetch migration guides before implementing changes.

Key v2 → v3 Changes

Feature v2 (Migrate From) v3 (Migrate To)

Provider <HeroUIProvider> required No Provider needed

Component API Flat props: <Card title="x"> Compound: <Card><Card.Header>

Event handlers onClick onPress

Styling classNames prop className prop

Hooks useSwitch, useDisclosure, etc. Compound components, useOverlayState

Packages @heroui/system, @heroui/theme @heroui/react, @heroui/styles

Accessing Migration Documentation

For migration details, examples, and step-by-step guides, always fetch documentation:

Using Scripts

# List all available component migration guides
node scripts/list_migration_guides.mjs

# Get main migration workflow (full or incremental)
node scripts/get_migration_guide.mjs full
node scripts/get_migration_guide.mjs incremental

# Get component-specific migration guides
node scripts/get_component_migration_guides.mjs button
node scripts/get_component_migration_guides.mjs button card modal

# Get styling migration guide
node scripts/get_styling_migration_guide.mjs

# Get hooks migration guide
node scripts/get_hooks_migration_guide.mjs

Direct URLs

Migration docs (preview): https://heroui-git-docs-migration-heroui.vercel.app/docs/react/migration/{filename}

Examples:

  • Full migration: .../agent-guide-full.mdx

  • Incremental: .../agent-guide-incremental.mdx

  • Button: .../button.mdx

  • Styling: .../styling.mdx

  • Hooks: .../hooks.mdx

Override base URL with HEROUI_MIGRATION_DOCS_BASE when docs are merged to production.

MCP Alternative

When using Cursor or other MCP clients, configure the Migration MCP server for tool-based access:

{
  "mcpServers": {
    "heroui-migration": {
      "url": "https://migration-mcp.heroui.com"
    }
  }
}

Migration Strategies

Full Migration

  • Best for: Projects that can dedicate focused time; teams comfortable with temporarily broken code

  • Migrate all component code first (project broken during migration)

  • Switch dependencies to v3

  • Complete styling migration

Incremental Migration

  • Best for: Projects that must stay functional; large codebases migrating gradually

  • Set up coexistence (pnpm aliases or component packages)

  • Migrate components one-by-one

  • Both v2 and v3 coexist during migration

Always fetch the agent guide before starting: node scripts/get_migration_guide.mjs full or incremental

Core Principles

  • Fetch first: Use scripts to get migration guides before applying changes

  • Compound components: v3 uses Card.Header, Card.Title, Button with children—not flat props

  • No Provider: Remove HeroUIProvider when migrating

  • onPress not onClick: All interactive components use onPress

  • Workflow: Analyze → Migrate components → Switch deps → Styling migration

Migration Workflow Summary

  • Create migration branch

  • Analyze project (HeroUI imports, component usage)

  • Fetch main guide: node scripts/get_migration_guide.mjs full

  • Migrate components in batches (fetch component guides per batch)

  • Switch dependencies to v3

  • Fetch styling guide: node scripts/get_styling_migration_guide.mjs

  • Apply styling updates

Preview Mode

This skill targets the staging deployment of the docs/migration branch. Once docs are merged to main and live on heroui.com, set HEROUI_MIGRATION_DOCS_BASE=https://heroui.com/docs/react/migration or update the default in scripts. Weekly Installs290Repositoryheroui-inc/herouiGitHub Stars28.7KFirst Seen10 days agoSecurity AuditsGen Agent Trust HubFailSocketPassSnykWarnInstalled oncodex288gemini-cli287amp287github-copilot287kimi-cli287opencode287

forum用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价,来写第一条吧

统计数据

安装量1.0K
评分4.4 / 5.0
版本1.0.0
更新日期2026年3月28日
对比案例1 组

用户评分

4.4(15)
5
0%
4
0%
3
0%
2
0%
1
0%

为此 Skill 评分

0.0

兼容平台

🔧Claude Code

时间线

创建2026年3月28日
最后更新2026年3月28日