Replies: 134 comments 69 replies
-
Goat 🐐 |
Beta Was this translation helpful? Give feedback.
-
I actually don't like the sonner toast but okay 👍 |
Beta Was this translation helpful? Give feedback.
-
Great, thanks! |
Beta Was this translation helpful? Give feedback.
-
thanks a lot @shadcn ! tested with a fresh nextjs and vite setup and it worked correctly. |
Beta Was this translation helpful? Give feedback.
-
Thanks |
Beta Was this translation helpful? Give feedback.
-
Tested with react router v7 and it works perfectly! Thank you @shadcn 🙏 |
Beta Was this translation helpful? Give feedback.
-
Woohoo! Thanks @shadcn! |
Beta Was this translation helpful? Give feedback.
-
Needed to import "path" in step 5: pnpm install --save-dev @types/node |
Beta Was this translation helpful? Give feedback.
-
Any advice for remix+vite?
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the update! It works with a clean Vite + React Router V7 setup, however I don't get asked whether to use new-york or default styles in the CLI, and just get new-york @shadcn Also, changing the |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Am I able to upgrade to stable release if i start with these canary version? |
Beta Was this translation helpful? Give feedback.
-
Does this means shadcn will not work with React 18 and older versions? |
Beta Was this translation helpful? Give feedback.
-
Thanks! Great job! |
Beta Was this translation helpful? Give feedback.
-
Hey, first of all, thanks @shadcn for the updates! My question is, can we still apply different themes? For me, applying any theme other than the default one doesn’t seem to work. 1. Default theme
2. New theme
|
Beta Was this translation helpful? Give feedback.
-
gracias por estar actualizados el soporte de tailwind 4 falta actualizar el codigo de los componentes v4 new york en la pagina de la documentacon oficial |
Beta Was this translation helpful? Give feedback.
-
I understand that tw4 removed default cursor on buttons (no idea why though) but isn't that something shadcnui should explicitly add wherever it fits? Right now I am adding it manually to all the components (i dont like the global css fix) such as button, checkbox, all kinds of triggers like dialog, popover, select etc. I mean shadcnui is an opinionated design, it does not have to follow whatever tailwind decides to do, right? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Title: Body: I recently upgraded a Next.js 14.2 project from Tailwind v3 to Tailwind v4. After the upgrade, several Radix UI components (from [shadcn/ui](https://github.com/shadcn/ui)), including the Here’s a minimal snippet of one of the affected components ( import {
Select,
SelectTrigger,
SelectContent,
SelectItem,
SelectValue,
} from "@/components/ui/select";
...
<Select onValueChange={field.onChange} value={field.value}>
<FormControl>
<SelectTrigger className="border-gray-300">
<SelectValue placeholder="Select role" />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="INTERNAL">Internal</SelectItem>
<SelectItem value="EXTERNAL_ADMIN">External Admin</SelectItem>
...
</SelectContent>
</Select> What I’ve observed:
element {
Still shows transparent. Has anyone encountered Tailwind v4 + Radix UI dropdowns rendering invisible backgrounds? Am I missing some new v4 config or a known fix for these theme variables? Any guidance or best practices for making the Thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Why are we not using https://caniuse.com/?search=light-dark Also, can someone explain the reason for pointing |
Beta Was this translation helpful? Give feedback.
-
Thanks for the hard work folks ! I am frequently checking the progress to see if upgrade has been finalized. Can i ask that when its done would you consider adding an upgrade guide in shadcn/ui website ? Also i wish React 19 and Tailwind v4 was a separate upgrade, React 19 having the priority as i see tw4 causing a lot of issues i think. |
Beta Was this translation helpful? Give feedback.
-
I don't know if this has been addressed yet to not. It's getting pretty tough to track all of this, but here goes. It seems the destructive example for Alert component is missing this I don't think the answer is to change this:
as this is now setup to handle the new TW 4 border inheritance. Not sure, exactly what the fix is, that is why I am posting. Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
Hello Everyone, I’m excited to share that we’ve successfully released Ontosight.ai after migrating from Ant Design v5 to Next.js 15, Tailwind CSS V4, and Shadcn@canary. The new setup has been running smoothly in production, and we’ve observed a significant boost in performance. A big thank you to @shadcn for the fantastic work on the library. I’ll be sharing my key learnings from the process soon. |
Beta Was this translation helpful? Give feedback.
-
I noticed that the inputs and some components use bg-transparent, which works well in light mode. However, in dark mode, they don’t appear to be transparent. Does anyone know where the code that controls this behavior is? From v4 shadcn demo: |
Beta Was this translation helpful? Give feedback.
-
Why was |
Beta Was this translation helpful? Give feedback.
-
Hi. I was wondering what happened to the old mode-toggle that included "system". Not sure why that was removed bc it was pretty great. ![]() |
Beta Was this translation helpful? Give feedback.
-
After applying the remove-forward-ref codemod, a mandatory ref attribute is applied to all shadcn components. For example, as in the upgade docs, for AccordionItem, this is what happens to my codebase: Before: 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", className)}
{...props}
/>
));
AccordionItem.displayName = "AccordionItem"; After: const AccordionItem = ({
ref,
className,
...props
}: React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> & {
ref: React.RefObject<React.ElementRef<typeof AccordionPrimitive.Item>>;
}) => (
<AccordionPrimitive.Item
ref={ref}
className={cn("border-b", className)}
{...props}
/>
);
AccordionItem.displayName = "AccordionItem"; What am I missing here? |
Beta Was this translation helpful? Give feedback.
-
The prefix option in Tailwind 4 should always come first.
However, the Canary version still uses the Tailwind 3 prefix approach, where it's placed at the front of the key-value class.
|
Beta Was this translation helpful? Give feedback.
-
just wanted to say that i really don't like the bg/color/tone/radius changes. i wish this was strictly tailwind & react update as the title suggests.. what you see on the shadcn website versus what you actually get is different visually. and also realized you removed some blocks again as well. i keep 3 or 4 if i remember correctly versions of shadcn in case i need to use some. they save quite some time when you actually need it i just don't understand why you keep removing them. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It’s here! Tailwind v4 and React 19. Ready for you to try out.
TLDR
If you're starting a new project with Tailwind v4 and React 19, use the
canary
version of the command-line:What's New
canary
) can now initialize projects with Tailwind v4.@theme
directive and@theme inline
option.data-slot
attribute for styling.toast
component in favor ofsonner
.default
style. New projects will usenew-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. Only new projects start with v4 and React 19.
What's Coming Next
The following is still being worked on. I'll post updates here.
See it Live
I put together a demo with all the updated components here: https://v4.shadcn.com
Take a look and test the components. If you find any bugs, leave a comment below.
Try It Out
You can test Tailwind v4 + React 19 today using the
canary
release of the CLI.I'm still working on the docs, but here's a quick guide to testing new projects:
Next.js
components.json
and set up your CSS variables:Vite
Follow the official guide to add Tailwind CSS: https://tailwindcss.com/docs/installation/using-vite
Add path aliases to
tsconfig.json
:tsconfig.app.json
:@types/node
:vite.config.ts
:shadcn/ui
. This will create yourcomponents.json
and set up your CSS variables:(Note: If you need help with other frameworks, drop a comment below. I'll update the guide)
Upgrade Your Project
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):
1. Follow the Tailwind v4 Upgrade Guide
@tailwindcss/upgrade@next
codemod to remove deprecated utility classes and update tailwind config.2. Update your CSS variables
The codemod will migrate your CSS variables as references under the
@theme
directive.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 inline {
hsl()
wrappers from@theme
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.
3. Update colors for charts
Now that the theme colors come with
hsl()
, you can remove the wrapper in yourchartConfig
:Use new
size-*
utilityThe new
size-*
utility (added in Tailwind v3.4), is now fully supported bytailwind-merge
. You can replacew-* h-*
with the newsize-*
utility:Update your dependencies
pnpm up "@radix-ui/*" cmdk lucide-react recharts tailwind-merge clsx --latest
Remove forwardRef
You can use the
preset-19
codemod to migrate yourforwardRef
to props or manually update the primitives.For the codemod, see https://react.dev/blog/2024/04/25/react-19-upgrade-guide#typescript-changes.
If you want to do it manually, here's how to do it step by step:
React.forwardRef<...>
withReact.ComponentProps<...>
ref={ref}
from the component.data-slot
attribute. This will come in handy for styling with Tailwind.displayName
.Before
After
Share Your Feedback
We’d love for you to test these updates and share your feedback! If you run into anything weird or have suggestions, add a comment below.
Beta Was this translation helpful? Give feedback.
All reactions