shadcn/ui Styling Conflicts with Tailwind
shadcn/ui components render with incorrect or no styling. Components appear unstyled or Tailwind utilities don't apply properly. CSS conflicts between component-scoped styles and global Tailwind.
This happens when Tailwind configuration isn't properly set up for shadcn/ui components, or CSS precedence issues cause styles to not apply.
Error Messages You Might See
Common Causes
- tailwind.config.ts content glob doesn't include node_modules for shadcn/ui components
- CSS file organization causes shadcn styles to be overridden by global styles
- Missing CSS variables defined in globals.css for shadcn theme
- Tailwind plugins like forms plugin conflicting with component styles
- Incorrect color theme configuration in tailwind.config.ts
How to Fix It
Update tailwind.config.ts: Ensure content array includes shadcn paths:content: ['./app/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}']
Add CSS variables: In globals.css, include shadcn theme variables before Tailwind directives.
Check CSS order: Ensure globals.css with @tailwind directives loads before component-specific CSS.
Verify component installation: Run npx shadcn-ui@latest init to regenerate configuration.
Real developers can help you.
You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.
Get HelpFrequently Asked Questions
Why aren't my shadcn components styled?
Check tailwind.config.ts content paths include shadcn components. Run 'npx shadcn-ui@latest init' to regenerate config.
How do I customize shadcn component colors?
Edit the component file directly in components/ui/, or modify CSS variables in globals.css for theme-wide changes.
Can I use shadcn/ui with other UI libraries?
Yes, but avoid naming conflicts. Test component interactions and CSS precedence when combining libraries.