HTMX
HTMX is a no-build JavaScript library that adds reactivity and DOM manipulation to HTML files using HTML attributes

Use daisyUI with HTMX

How to install and use daisyUI with HTMX

This guide uses daisyUI as a Node.js dependency. If you don't want to use Node.js, try theCDN version of daisyUI.

1. Install

Initialize a new Node project in the current directory usingnpm init -yif it's not a Node project already.

Install Tailwind CSS CLI and daisyUI

Terminal
npm install tailwindcss@latest @tailwindcss/cli@latest daisyui@latest

2. Add Tailwind CSS and daisyUI

Add Tailwind CSS and daisyUI to your CSS file.
Address your HTML and other markup files in thesourcefunction.

app.css
@import "tailwindcss" source(none);
@source "./public/*.{html,js}";
@plugin "daisyui";

3. Build CSS

Add a script to your package.json to build the CSS.

package.json
{
  "scripts": {
    "build:css": "npx @tailwindcss/cli -i app.css -o public/output.css"
  },
}

Run the script to build the CSS file

Terminal
npm run build:css

This command creates apublic/output.cssfile with the compiled CSS. You can link this file to your HTML file.

public/index.html
<link href="./output.css" rel="stylesheet">

Now you can use daisyUI class names!

Do you have a question? Ask on GitHub or Discord server
Do you like daisyUI? Post about it!
Support daisyUI's development: Open Collective
daisyUI store

NEXUS
Official daisyUI Dashboard Template

Available on daisyUI store

More details
OSZAR »