Launch Week Day 5: Introducing Reachability for PHP.Learn More
Socket
Book a DemoSign in
Socket

@headlessui/tailwindcss

Package Overview
Dependencies
Maintainers
5
Versions
540
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@headlessui/tailwindcss

A complementary Tailwind CSS plugin

Source
npmnpm
Version
0.0.0-insiders.b0615ad
Version published
Weekly downloads
938K
4.37%
Maintainers
5
Weekly downloads
 
Created
Source

@headlessui/tailwindcss

A complementary Tailwind CSS plugin for Headless UI

Total Downloads Latest Release License

Installation

npm install @headlessui/tailwindcss
// tailwind.config.js
module.exports = {
  content: [],
  theme: {
    extend: {},
  },
  plugins: [
    require('@headlessui/tailwindcss')

    // Or with a custom prefix:
    require('@headlessui/tailwindcss')({ prefix: 'ui' })
  ],
}

Documentation

Use Tailwind CSS utilities for styling the components based on their state. You can use the following variants:

VariantInverse variant
ui-openui-not-open
ui-checkedui-not-checked
ui-selectedui-not-selected
ui-activeui-not-active
ui-disabledui-not-disabled
ui-focus-visibleui-not-focus-visible

Example:

import { Menu } from '@headlessui/react'

function MyDropdown() {
  return (
    <Menu>
      <Menu.Button>More</Menu.Button>
      <Menu.Items>
        <Menu.Item>
          <a
            className="ui-active:bg-blue-500 ui-active:text-white ui-not-active:bg-white ui-not-active:text-black"
            href="/account-settings"
          >
            Account settings
          </a>
        </Menu.Item>
        {/* ... */}
      </Menu.Items>
    </Menu>
  )
}

Community

For help, discussion about best practices, or feature ideas:

Discuss Headless UI on GitHub

FAQs

Package last updated on 17 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts