daisyUI v5.6 is now available!

HTMX Tailwind CSS

Use Tailwind CSS and daisyUI with HTMX without class-heavy fragments

HTMX Tailwind CSS

Tailwind CSS works well with HTMX

HTMX keeps interaction in HTML attributes. Tailwind CSS pairs well with that because it also keeps styling in the markup. You can build server-rendered fragments that carry both behavior and presentation without a client framework.

That directness is useful, especially for forms, filters, tables, and inline updates. A fragment can return from the server ready to display and ready to respond to the next interaction.

The trouble is density. hx-* attributes already add meaning to the markup. Long Tailwind CSS class strings beside them can make fragments hard to scan.

HTMX markup can run out of breathing room

An HTMX button may include a URL, target, swap strategy, indicator, disabled state, and accessibility text. Add a long utility chain and the element becomes hard to edit.

LLMs also spend tokens on both sets of attributes. If the goal is to change server interaction, repeated utility classes become expensive background noise.

HTMX + Tailwind CSS + daisyUI

daisyUI shortens repeated UI classes while preserving the HTML-first model.

  • : class="btn btn-primary" is easier to read beside hx-post and hx-target.

  • Works with swaps: daisyUI has no JavaScript binding layer, so HTMX can replace fragments freely.

  • : alert, card, table, modal, and loading cover common server-rendered UI.

  • Tailwind CSS remains precise: Add utilities for one-off layout and responsive behavior.

HTMX keeps behavior declarative. daisyUI makes Tailwind CSS less noisy in the HTML that carries it.

daisyUI is so good! I love how it sticks with the basic HTML components. Truly great.

Nico Devs
Software Engineer

DaisyUI just looks amazing.

Kelvin Htat
Solo founder

I used daisyUI theme generator's Halloween theme and tweaked it to what I want and now, I'm so proud of what I've got!

Ade
Software Engineer

daisyUI really makes it super easy to get a clean looking MVP up and out the door.

Josh Cirre
Entrepreneur

I'm glad I found daisyUI. daisyUI is built with Tailwind CSS which makes it perfect fit for me.

Rem Kim
Founder of resolveai.co

I've been *enjoying daisyui* since I discovered it very recently, great job!

Vincent Bergeron
Software Developer

Install Tailwind CSS and daisyUI for HTMX

The HTMX guide uses Tailwind CSS CLI and daisyUI as Node dependencies. Add @import "tailwindcss" and @plugin "daisyui" to your CSS file, build it, and link the generated CSS from your HTML.

For the exact commands, see How to install daisyUI with HTMX.

daisyUI is the most popular
component library for Tailwind CSS

Used by engineers at

Meta Research
Alibaba
Amazon
Adobe
Pepsico
Google Cloud