chakra-ui-builder
Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing…
Migrate Chakra UI projects from v2 to v3, covering package changes, codemods, provider setup, color mode, prop renaming, compound components, theming, recipes, and Next.js updates. Use this skill whenever a user is upgrading Chakra UI versions, encountering breaking changes
Claude Code
$ npx -y skills add chakra-ui/chakra-ui --skill chakra-ui-migrate --agent claude-code
Codex
$ npx skills add chakra-ui/chakra-ui --skill chakra-ui-migrate -a codex -y
Cursor
$ npx skills add chakra-ui/chakra-ui --skill chakra-ui-migrate -a cursor -y
Gemini CLI
$ npx skills add chakra-ui/chakra-ui --skill chakra-ui-migrate -a gemini-cli -y
GitHub Copilot
$ npx skills add chakra-ui/chakra-ui --skill chakra-ui-migrate -a github-copilot -y
OpenCode
$ npx skills add chakra-ui/chakra-ui --skill chakra-ui-migrate -a opencode -y
Windsurf
$ npx skills add chakra-ui/chakra-ui --skill chakra-ui-migrate -a windsurf -y
name: chakra-ui-migrate description: > Migrate Chakra UI projects from v2 to v3, covering package changes, codemods, provider setup, color mode, prop renaming, compound components, theming, recipes, and Next.js updates. Use this skill whenever a user is upgrading Chakra UI versions, encountering breaking changes after an upgrade, converting old v2 patterns (ColorModeScript, useColorModeValue, styleConfig, extendTheme, isDisabled, colorScheme, @chakra-ui/icons, framer-motion dependency), fixing compound component patterns, or asking about differences between Chakra UI v2 and v3 — even if they don't say "migrate" or "upgrade" explicitly.
You are guiding a developer through migrating their project from Chakra UI v2 to v3. Work through the steps below in order. Inspect the project first — never guess the package versions or framework.
> **Node requirement:** Chakra UI v3 requires Node >= 20.x. Confirm before > proceeding if the environment is uncertain.
---
Read these files to understand the current state:
package.json
Look for:
`@chakra-ui/next-js`, `@emotion/styled`, `framer-motion`
`package-lock.json`)
Also spot-check key files when helpful:
---
# npm npm uninstall @chakra-ui/icons @chakra-ui/hooks @chakra-ui/next-js @emotion/styled framer-motion # pnpm pnpm remove @chakra-ui/icons @chakra-ui/hooks @chakra-ui/next-js @emotion/styled framer-motion # yarn yarn remove @chakra-ui/icons @chakra-ui/hooks @chakra-ui/next-js @emotion/styled framer-motion
`@emotion/styled` and `framer-motion` are no longer required in v3.
# npm npm install @chakra-ui/react @emotion/react # pnpm pnpm add @chakra-ui/react @emotion/react # yarn yarn add @chakra-ui/react @emotion/react
| Removed | Replacement | | -------------------- | -------------------------------------------- | | `@chakra-ui/icons` | `lucide-react` or `react-icons` | | `@chakra-ui/hooks` | `react-use` or `usehooks-ts` | | `@chakra-ui/next-js` | `asChild` prop pattern (see Next.js section) |
---
The official codemod handles most mechanical changes: component renames, prop updates, import rewrites, and compound component restructuring. It does not replace manual review — plan to audit the output.
**Dry run first (no files changed):**
npx @chakra-ui/codemod upgrade --dry
Review what it proposes. When satisfied:
npx @chakra-ui/codemod upgrade
After the codemod, commit the changes before making manual edits so you have a clean diff to work from.
---
// v2
import { ChakraProvider } from "@chakra-ui/react"
import theme from "./theme"
;<ChakraProvider theme={theme}>{children}</ChakraProvider>Generate the provider and component snippets:
npx @chakra-ui/cli snippet add
This creates `components/ui/provider.tsx` (plus `toaster` and `tooltip` snippets) and automatically installs required npm dependencies — including `next-themes`. Import and use it:
// v3 — app/layout.tsx (Next.js App Router)
import { Provider } from "@/components/ui/provider"
;<html lang="en" suppressHydrationWarning>
<body>
<Provider>{children}</Provider>
</body>
</html>The `Provider` file includes `"use client"` — do not add it to `layout.tsx`. See the Next.js section for Pages Router placement.
Replace `extendTheme` with `createSystem`:
// v2
import { extendTheme } from "@chakra-ui/react"
// v3
import { createSystem, defaultConfig, defineConfig } from "@chakra-ui/react"
export const theme = extendTheme({ colors: { brand: { 500: "#2196f3" } } })
const config = defineConfig({
theme: { tokens: { colors: { brand: { 500: { value: "#2196f3" } } } } },
})
export const system = createSystem(defaultConfig, config)Pass `system` to `ChakraProvider` via `value={system}`.
---
// REMOVE these v2 imports and usages:
import { ColorModeScript } from "@chakra-ui/react"
// ❌
import { useColorMode } from "@chakra-ui/react"
// ❌ (use next-themes)
import { useColorModeValue } from "@chakra-ui/react"
// ❌ (use CSS tokens)
import { DarkMode, LightMode } from "@chakra-ui/react"
// ❌
// Also remove from _document.tsx:
;<ColorModeScript initialColorMode={theme.config.initialColorMode} /> // ❌Color mode is handled by `next-themes` via the generated `Provider`. Use semantic tokens that automatically respond to the active color mode:
// Use Chakra semantic tokens — they flip automatically in dark mode <Box color="fg.default" bg="bg.subtle"> ... </Box>
For a color mode toggle, use the generated `components/ui/color-mode.tsx` snippet or `useColorMode` from `next-themes` directly.
---
These boolean and style props were renamed in v3 for consistency with HTML and modern React conventions. The codemod catches most of these, but verify manually afterward.
| v2 | v3 | | ----------------- | --------------- | | `isOpen` | `open` | | `defaultIsOpen` | `defaultOpen` |
Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing…
Review, convert, and improve UI code using Chakra UI v3. Use this skill whenever a user wants to review Chakra UI code for…
Migrates React projects and components from Radix UI to Base UI. Use when asked to migrate from radix, move to base-ui, convert…
tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One…