Use Tailwind CSS and daisyUI in Rails with cleaner ERB
Rails rewards building useful HTML quickly. Tailwind CSS supports that by letting you style ERB, partials, helpers, and view components without leaving the file to invent CSS names.
For product teams, that is a strong default. You can build forms, tables, dashboards, account pages, and admin screens with one styling language. Tailwind CSS also works well with Turbo and Stimulus because it stays out of behavior.
The maintenance issue shows up later. ERB gets packed with utilities. A partial that should show a simple component can become a dense strip of spacing, color, border, focus, and responsive classes.
Rails templates already contain paths, helpers, translations, Turbo frames, conditional rendering, and model data. Long Tailwind CSS class strings make those details harder to review.
AI tools pay the same tax. Repeated utilities consume LLM context, especially in generated view components and partials. That leaves fewer tokens for understanding routes, models, and user flows.
daisyUI gives Rails a shorter UI vocabulary while keeping Tailwind CSS available.
: Use btn, card, table, alert, and navbar for repeated UI.
Hotwire stays in charge: Turbo and Stimulus manage behavior. daisyUI only styles elements.
Less generated noise: AI-generated Rails views can use semantic component classes instead of huge utility chains.
Full Tailwind CSS control: Add utilities for custom layout, spacing, and responsive detail whenever needed.
Rails keeps the server-rendered workflow. daisyUI keeps repeated interface code easier to read.
The Rails guide starts with the Tailwind CSS Rails gem, then offers Node dependency, bundle file, and CDN options for daisyUI. The Node and bundle-file paths use @plugin "daisyui" or local daisyUI plugin files.
For the exact setup, see How to install daisyUI with Ruby on Rails.
Used by engineers at