How did Vite, Tailwind CSS, and React Router fit together in early 2025?

March 2, 2025

By early 2025, the official React Router v7 default template already connected routing, building, and styling. Take a settings page that a visitor can open directly at /settings. Each tool has a distinct job.123

TaskWho handles itWhat you see in the project
Show a settings form at /settingsReact Router matches the URL to a route module. A React component describes the form.The framework template registers routes in app/routes.ts, with components in the corresponding modules.
See edits immediately and generate files for releaseVite supplies the development server and production build. The React Router Vite plugin connects the framework’s routing conventions.The development command is react-router dev. Both tools share a vite.config.ts.
Add padding to a button and change its color on hoverTailwind CSS recognizes utility classes in source code at build time and generates their CSS.Write className="px-3 py-2 hover:bg-blue-600" directly in JSX. The browser draws the button using the generated stylesheet.

The combination saves integration work. The default template enables reactRouter() and Tailwind CSS 4’s official tailwindcss() plugin in vite.config.ts, then imports tailwindcss in app/app.css. Add hover:bg-blue-600 to a button and the plugin generates the hover style. The tool here is Tailwind CSS. The similarly named Twind is a separate project that can generate CSS at runtime.145

Why is the official template under remix-run, and where does Shopify come in?

The two authors of React Router later built the full-stack Remix framework on top of their router. Shopify acquired Remix in 2022 and used it for the new version of its Hydrogen storefront toolkit. React Router v7, released in 2024, incorporated Remix v2 framework features including Vite integration and server-side rendering. Thus remix-run/react-router-templates supplies React Router templates that you can use independently.678

Can the template save running a service at deployment time too?

It depends on how the app renders. The February 2025 default template specified ssr: true, and its startup script ran react-router-serve ./build/server/index.js. SSR means server-side rendering: when someone requests a URL, the server can generate that page’s HTML first. The configuration is in place, but deployment still requires an environment that can run server code.1

If the settings page only needs to run in the browser, React Router v7 framework mode also lets you set ssr to false. The build prerenders the root route and generates an HTML entry point. You can deploy build/client to a static host. To support visiting or refreshing /settings directly, configure the host to route that address to the entry HTML. If the form saves data remotely, the API that receives it still has its own deployment requirements.9

References

Footnotes

  1. React Router contributors. (2025, February 7). React Router Templates [default template, commit 4c84712]. GitHub. Official template repository, Dependencies and startup scripts in the historical version, Vite plugins, Routing and stylesheet entries, SSR configuration. ↩ ↩2 ↩3

  2. Vite contributors. (n.d.). Getting Started. Vite. Development server and production build. ↩

  3. Tailwind Labs. (n.d.). Install Tailwind CSS with React Router. Tailwind CSS. React Router installation guide. ↩

  4. Wathan, A. (2025, January 22). Tailwind CSS v4.0. Tailwind CSS. First-party Vite plugin. ↩

  5. Twind contributors. (n.d.). Getting Started: Installation. Twind. Compiling utility classes at runtime. ↩

  6. Shopify Engineering. (2022, October 31). Mixing It Up: Remix Joins Shopify to Push the Web Forward. Shopify. Team background and announcement. ↩

  7. Shopify. (2023, February 9). Winter ’23 Editions: Remixing Hydrogen. Hydrogen. “How did we get here?” and the new Hydrogen’s positioning. ↩

  8. Jackson, M. (2024, November 22). React Router v7. Remix. Stable release announcement, “Upgrading”. ↩

  9. React Router contributors. (n.d.). Single Page App (SPA) [v7.2.0]. GitHub. Disabling runtime SSR and deploying a single-page app. ↩

© 2025 borui. All rights reserved. This content may be freely reproduced, displayed, modified, or distributed with proper attribution to borui and a link to the article: borui (2025-03-02). How did Vite, Tailwind CSS, and React Router fit together in early 2025?. https://caiborui.com/blog/2025-03-02-zh-tailwind-vite-react-router-entrans

@misc{borui2025-7092870b,
  author = {borui},
  title = {{How did Vite, Tailwind CSS, and React Router fit together in early 2025?}},
  year = {2025},
  publisher = {borui's blog},
  url = {https://caiborui.com/blog/2025-03-02-zh-tailwind-vite-react-router-entrans}
}