0.1.2 • Published 6 months ago

tailwind-htmx v0.1.2

Weekly downloads
-
License
-
Repository
-
Last release
6 months ago

tailwind-htmx

Variants for styling htmx classes with Tailwind CSS

Getting Started

Installation

Install the plugin from npm:

npm install -D tailwind-htmx

Then add the plugin to your tailwind.config.js file:

/** @type {import('tailwindcss').Config} */
module.exports = {
  theme: {
    // ...
  },
  plugins: [
    require('tailwind-htmx'),
    // ...
  ],
};

Configuration

You can change the default class names to generate with the following options:

// tailwind.config.js

module.exports = {
  ...,
  plugins: [
    require('tailwind-htmx')({
      classNames: {
        settling: 'htmx-settling';
        request: 'htmx-request';
        swapping: 'htmx-swapping';
        added: 'htmx-added';
      };
    }),
  ],
};

Usage

<div>
  <button hx-post="/example">Post It!</button>
  <img id="spinner" class="invisible htmx-request:visible" src="/img/bars.svg" />
</div>
0.1.2

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago