Update: We have added full support for React 19 and Tailwind v4 in the
latest release. This guide might be outdated. Proceed with caution.TL;DR
If you’re usingnpm, you can install shadcn/ui dependencies with a flag. The shadcn CLI will prompt you to select a flag when you run it. No flags required for pnpm, bun, or yarn.
See Upgrade Status for the status of React 19 support for each package.
What’s happening?
React 19 is now rc and is tested and supported in the latest Next.js 15 release. To support React 19, package maintainers will need to test and update their packages to include React 19 as a peer dependency. This is already in progress.You can check if a package lists React 19 as a peer dependency by running
npm info <package> peerDependencies.Note: This is npm only. PNPM and Bun will only show a silent warning.
How to fix this
Solution 1: --force or --legacy-peer-deps
You can force install a package with the --force or the --legacy-peer-deps flag.
What do the flags do?
--force: Ignores and overrides any dependency conflicts, forcing the installation of packages.--legacy-peer-deps: Skips strict peer dependency checks, allowing installation of packages with unmet peer dependencies to avoid errors.
Solution 2: Use React 18
You can downgradereact and react-dom to version 18, which is compatible with the package you are installing and upgrade when the dependency is updated.
Using shadcn/ui on Next.js 15
Using pnpm, bun, or yarn
Follow the instructions in the installation guide to install shadcn/ui. No flags are needed.Using npm
When you runnpx shadcn@latest init -d, you will be prompted to select an option to resolve the peer dependency issues.
Adding components
The process for adding components is the same as above. Select a flag to resolve the peer dependency issues. Remember to always test your app after installing new dependencies.Upgrade Status
To make it easy for you track the progress of the upgrade, here’s a table with React 19 support status for the shadcn/ui dependencies.- ✅ - Works with React 19 using npm, pnpm, and bun.
- 🚧 - Works with React 19 using pnpm and bun. Requires flag for npm. PR is in progress.
| Package | Status | Note |
|---|---|---|
| radix-ui | ✅ | |
| lucide-react | ✅ | |
| class-variance-authority | ✅ | Does not list React 19 as a peer dependency. |
| tailwindcss-animate | ✅ | Does not list React 19 as a peer dependency. |
| embla-carousel-react | ✅ | |
| recharts | ✅ | See note below |
| react-hook-form | ✅ | |
| react-resizable-panels | ✅ | |
| sonner | ✅ | |
| react-day-picker | ✅ | Works with flag for npm. Work to upgrade to v9 in progress. |
| input-otp | ✅ | |
| vaul | ✅ | |
| @radix-ui/react-icons | ✅ | See PR #194 |
| cmdk | ✅ |
Recharts
To use recharts with React 19, you will need to override thereact-is dependency.