Tailwind v4

TailwindCSS v4 is now available in Beta! This guide will help you migrate your existing TailwindCSS v4 project to HeroUI. The demonstration is available at https://beta.heroui.com/.


Migration Steps

  1. Follow the official Tailwind v4 upgrade guide
  2. Install the beta version of HeroUI
  1. Configure HeroUI with the new Tailwind v4 syntax

Update CSS Import

Without tailwind.config.js

Since Tailwind v4 favors a CSS-first approach, tailwind.config.js will not be required.

Create hero.ts file

Update your main css file

With tailwind.config.js

In Tailwind v4, tailwind.config.js is still supported for backward compatibility. If you still need to use it, you can load it explicity as below.

Update PostCSS Configuration

Update Vite Configuration (Vite Projects Only)

Verification

After migration, verify that:

  1. Your styles are being applied correctly
  2. The build process completes without errors
  3. HeroUI components render as expected

Make sure to check the Tailwind v4 documentation for any breaking changes that might affect your existing styles.

Need Help?

If you encounter any issues during migration, please: