Ruby on Rails Tailwind CSS

Use Tailwind CSS and daisyUI in Rails with cleaner ERB

Rails Tailwind CSS

Tailwind CSS fits the Rails way

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 views need readable intent

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.

Rails + Tailwind CSS + daisyUI

daisyUI gives Rails a shorter UI vocabulary while keeping Tailwind CSS available.

  • Cleaner ERB: 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.

daisyUI is a *joy to use* 🙏

Oli Nelson
Indie Software Dev

Honestly, I spent like 20% of my time writing code and 80% of time playing with Tailwind CSS and daisyUI. Really love the daisyUI themes 😍

Jiří Kratochvíl
vuejs.berlin co-organizer

daisyUI has been my "go-to" for side projects and vibe coding for this past year

Joro Yordanov
Designer

daisyUI is the only way to use tailwind

Suspect
Dev

Adding daisyUI to the front and adding new features to the products really affect all of our metrics.

Manuel Gracia
Developer

I love daisyUI and we used it for a hackathon project last week

Loftwah
DevOps Engineer

Install Tailwind CSS and daisyUI for Ruby on Rails

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.

daisyUI is the most popular
component library for Tailwind CSS

Used by engineers at

Meta Research
Alibaba
Amazon
Adobe
Pepsico
Google Cloud