apps/docs/content/docs/react/migration/(workflows)/agent-guide-incremental.mdx
This guide is designed for AI assistants (agents) helping users migrate from HeroUI v2 to v3 using incremental coexistence migration. This approach allows v2 and v3 components to work side-by-side, enabling component-by-component migration while keeping the project functional.
<Callout type="info"> **Key Difference**: Unlike full migration, incremental coexistence migration allows the project to remain functional during migration. Both v2 and v3 components can coexist temporarily. </Callout><include>../index.mdx#major-changes</include>
For detailed setup and migration instructions, see the Incremental Migration Guide. The guide covers:
For projects using incremental coexistence strategies, agents should:
Identify the strategy: Check if project uses pnpm aliases (Strategy A) or component packages (Strategy B)
"@heroui-v3/react": "npm:@heroui/react@latest" in package.json@heroui/button, @heroui/card alongside @heroui/reactVerify setup: Ensure the coexistence setup is correct:
@heroui/react (v2) and @heroui-v3/react (v3 alias) are installed@heroui/react (v3) and component packages like @heroui/button (v2) are installedIdentify component to migrate
get_component_migration_guides MCP tool to fetch component-specific guideUpdate imports
@heroui/react to @heroui-v3/reactimport {Button} from "@heroui/react" → import {Button} from "@heroui-v3/react"Update component code
get_component_migration_guides toolTest the migrated component
Document migration
Identify component to migrate
get_component_migration_guides MCP tool to fetch component-specific guideRemove component package
@heroui/button)Update imports
@heroui/react (v3)import {Card} from "@heroui/card" → import {Card} from "@heroui/react"Update component code
get_component_migration_guides toolTest the migrated component
Document migration
When encountering v2 components with no v3 counterpart (Code, Image, Navbar, Ripple, Snippet, Spacer, User):
get_component_migration_guides (where available) or the Component Migration Reference to fetch guides and help replace with native HTML or manual implementationsDuring coexistence, both v2 and v3 CSS systems will be loaded. Agents should:
Monitor for conflicts
Guide conflict resolution
tailwindcss first, then @heroui/stylesTest styling after each migration
<include>../index.mdx#step-6-component-migration-reference</include>
Use the get_component_migration_guides MCP tool to fetch detailed guides for each component.
<include>../index.mdx#new-components-in-v3</include>
Once all components are migrated:
Remove v2 dependencies
@heroui/react, @heroui/theme, and aliases@heroui/* component packagesUpdate all imports
@heroui-v3/react → @heroui/react@heroui/react (v3)Update CSS configuration
@import "@heroui/styles";Complete styling migration
get_styling_migration_guide MCP toolKey Differences:
When to Use Incremental Coexistence:
When to Use Full Migration:
@heroui/react package (Strategy A can work but full migration may be simpler)Verify project remains functional
Guide component-by-component migration
get_component_migration_guides MCP tool for each componentMonitor CSS conflicts
Track migration progress
Guide completion steps
After completing migration:
heroui-react MCP for v3 development