Replies: 112 comments 12 replies
-
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.
-
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.
-
The Geist font isn't working in the demo v4.shadcn.com |
Beta Was this translation helpful? Give feedback.
-
Not sure it is known, but clicking on sidebar edges is not making it smaller. Once you update blocks to tailwind 4/the new shadcn/ui, you will see this. I was using code similar to the first block and got this. |
Beta Was this translation helpful? Give feedback.
-
I had a fresh install for a new project. I get an error every time I add a component because adding a component puts
in my index.css... however with fresh tailwind4 with shadcnui/canary instructions, there is no tailwind.config.js to define border-border and this causes an error. For now, working around by just manually deleting this block so there is no default styling on components. Just using my own inline styling on each component. |
Beta Was this translation helpful? Give feedback.
-
Testing locally, is |
Beta Was this translation helpful? Give feedback.
-
@shadcn So I'm using |
Beta Was this translation helpful? Give feedback.
-
Buttons don't have a
|
Beta Was this translation helpful? Give feedback.
-
Not sure if you were responding to me, but my issues is for all components. |
Beta Was this translation helpful? Give feedback.
-
@kangpeter5 I was not responding to you, sorry. 🙁 🙂 |
Beta Was this translation helpful? Give feedback.
-
We're using turborepo and would love an update on this. |
Beta Was this translation helpful? Give feedback.
-
@elijaholmos Here is the new components.json from the v4 website, you could find all the V4 code (css, config, components) in https://github.com/shadcn-ui/ui/blob/main/apps/v4/components.json |
Beta Was this translation helpful? Give feedback.
-
For some reason borders are not applied to any component, this is my globals.css @plugin "tailwindcss-animate";
@custom-variant dark (&:is(.dark *));
:root {
--card: hsl(0 0% 100%);
--card-foreground: hsl(222.2 84% 4.9%);
--popover: hsl(0 0% 100%);
--popover-foreground: hsl(222.2 84% 4.9%);
--primary: hsl(222.2 47.4% 11.2%);
--primary-foreground: hsl(210 40% 98%);
--secondary: hsl(210 40% 96.1%);
--secondary-foreground: hsl(222.2 47.4% 11.2%);
--muted: hsl(210 40% 96.1%);
--muted-foreground: hsl(215.4 16.3% 46.9%);
--accent: hsl(210 40% 96.1%);
--accent-foreground: hsl(222.2 47.4% 11.2%);
--destructive: hsl(0 84.2% 60.2%);
--destructive-foreground: hsl(210 40% 98%);
--border: hsl(214.3 31.8% 91.4%);
--input: hsl(214.3 31.8% 91.4%);
--ring: hsl(222.2 84% 4.9%);
--chart-1: hsl(12 76% 61%);
--chart-2: hsl(173 58% 39%);
--chart-3: hsl(197 37% 24%);
--chart-4: hsl(43 74% 66%);
--chart-5: hsl(27 87% 67%);
--radius: 0.6rem;
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.87 0 0);
--background: hsl(0 0% 100%);
--foreground: hsl(222.2 84% 4.9%);
}
.dark {
--background: hsl(222.2 84% 4.9%);
--foreground: hsl(210 40% 98%);
--card: hsl(222.2 84% 4.9%);
--card-foreground: hsl(210 40% 98%);
--popover: hsl(222.2 84% 4.9%);
--popover-foreground: hsl(210 40% 98%);
--primary: hsl(210 40% 98%);
--primary-foreground: hsl(222.2 47.4% 11.2%);
--secondary: hsl(217.2 32.6% 17.5%);
--secondary-foreground: hsl(210 40% 98%);
--muted: hsl(217.2 32.6% 17.5%);
--muted-foreground: hsl(215 20.2% 65.1%);
--accent: hsl(217.2 32.6% 17.5%);
--accent-foreground: hsl(210 40% 98%);
--destructive: hsl(0 62.8% 30.6%);
--destructive-foreground: hsl(210 40% 98%);
--border: hsl(217.2 32.6% 17.5%);
--input: hsl(217.2 32.6% 17.5%);
--ring: hsl(212.7 26.8% 83.9%);
--chart-1: hsl(220 70% 50%);
--chart-2: hsl(160 60% 45%);
--chart-3: hsl(30 80% 55%);
--chart-4: hsl(280 65% 60%);
--chart-5: hsl(340 75% 55%);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(0.269 0 0);
--sidebar-ring: oklch(0.439 0 0);
}
@theme inline {
--font-sans: var(--font-geist-sans);
--font-mono: var(--font-geist-mono);
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-chart-1: var(--chart-1);
--color-chart-2: var(--chart-2);
--color-chart-3: var(--chart-3);
--color-chart-4: var(--chart-4);
--color-chart-5: var(--chart-5);
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
--color-sidebar: var(--sidebar);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
}
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}``` |
Beta Was this translation helpful? Give feedback.
-
In order to use tailwindcss v4 in monorepo, we can refer to this issue. In globals.css: @import "tailwindcss";
@source "../app/**/*.{ts,tsx}";
@source "../components/**/*.{ts,tsx}";
@source "../../../packages/ui/components/**/*.{ts,tsx}";
link pr #6724: use tailwindcss v4 in monorepo example. |
Beta Was this translation helpful? Give feedback.
-
hey @shadcn , thanks for the updates! |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I attempted to set up |
Beta Was this translation helpful? Give feedback.
-
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