Loading dashboard...
Loading dashboard...
It’s here! Tailwind v4 and React 19. Ready for you to try out. You can start using it today.
@theme directive and @theme inline option.data-slot attribute for styling.toast component in favor of sonner.default style. New projects will use new-york.Note: this is non-breaking. Your existing apps with Tailwind v3 and React 18 will still work. When you add new components, they'll still be in v3 and React 18 until you upgrade. Only new projects start with Tailwind v4 and React 19.
You can test Tailwind v4 + React 19 today using the canary release of the CLI. See the framework specific guides below for how to get started.
Important: Before upgrading, please read the Tailwind v4 Compatibility Docs and make sure your project is ready for the upgrade. Tailwind v4 uses bleeding-edge browser features and is designed for modern browsers.
One of the major advantages of using shadcn/ui is that the code you end up with is exactly what you'd write yourself. There are no hidden abstractions.
This means when a dependency has a new release, you can just follow the official upgrade paths.
Here's how to upgrade your existing projects (full docs are on the way):
@tailwindcss/upgrade@next codemod to remove deprecated utility classes and update tailwind config.The codemod will migrate your CSS variables as references under the @theme directive.
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 0 0% 3.9%;
}
}
@theme {
--color-background: hsl(var(--background));
--color-foreground: hsl(var(--foreground));
}This works. But to make it easier to work with colors and other variables, we'll need to move the hsl wrappers and use @theme inline.
Here's how you do it:
:root and .dark out of the @layer base.hsl()inline option to @theme i.e @theme inlinehsl() wrappers from @theme:root {
--background: hsl(0 0% 100%); // <-- Wrap in hsl
--foreground: hsl(0 0% 3.9%);
}
.dark {
--background: hsl(0 0% 3.9%); // <-- Wrap in hsl
--foreground: hsl(0 0% 98%);
}
@theme inline {
--color-background: var(--background); // <-- Remove hsl
--color-foreground: var(--foreground);
}This change makes it much simpler to access your theme variables in both utility classes and outside of CSS for eg. using color values in JavaScript.
Now that the theme colors come with hsl(), you can remove the wrapper in your chartConfig:
const chartConfig = {
desktop: {
label: "Desktop",
- color: "hsl(var(--chart-1))",
+ color: "var(--chart-1)",
},
mobile: {
label: "Mobile",
- color: "hsl(var(--chart-2))",
+ color: "var(--chart-2)",
},
} satisfies ChartConfigsize-* utilityThe new size-* utility (added in Tailwind v3.4), is now fully supported by tailwind-merge. You can replace w-* h-* with the new size-* utility:
- w-4 h-4
+ size-4pnpm up "@radix-ui/*" cmdk lucide-react recharts tailwind-merge clsx --latestYou can use the remove-forward-ref codemod to migrate your forwardRef to props or manually update the primitives.
For the codemod, see https://github.com/reactjs/react-codemod#remove-forward-ref.
If you want to do it manually, here's how to do it step by step:
React.forwardRef<...> with React.ComponentProps<...>ref={ref} from the component.data-slot attribute. This will come in handy for styling with Tailwind.displayName.const AccordionItem = React.forwardRef<
React.ElementRef<typeof AccordionPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
>(({ className, ...props }, ref) => (
<AccordionPrimitive.Item
ref={ref}
className={cn("border-b last:border-b-0", className)}
{...props}
/>
))
AccordionItem.displayName = "AccordionItem"function AccordionItem({
className,
...props
}: React.ComponentProps<typeof AccordionPrimitive.Item>) {
return (
<AccordionPrimitive.Item
data-slot="accordion-item"
className={cn("border-b last:border-b-0", className)}
{...props}
/>
)
}tailwindcss-animateWe've deprecated tailwindcss-animate in favor of tw-animate-css.
New project will have tw-animate-css installed by default.
For existing projects, follow the steps below to migrate.
tailwindcss-animate from your dependencies.@plugin 'tailwindcss-animate' from your globals.css file.tw-animate-css as a dev dependency.@import "tw-animate-css" to your globals.css file.- @plugin 'tailwindcss-animate';
+ @import "tw-animate-css";We've revisted the dark mode colors and updated them to be more accessible.
If you're running an existing Tailwind v4 project (not an upgraded one1), you can update your components to use the new dark mode colors by re-adding your components using the CLI2.
The CLI will overwrite your existing components. We recommend committing any changes you've made to your components before running the CLI.
git add .
git commit -m "..."Update the dark mode colors in your globals.css file to new OKLCH colors. See the Base Colors reference for a list of colors.
Review and re-apply any changes you made to your components.