File: README.md
Headless UI
Documentation
For full documentation, visit headlessui.com.
Installing the latest version
You can install the latest version by using:
npm install @headlessui/react@latestnpm install @headlessui/vue@latest
Installing the insiders version
You can install the insiders version (which points to whatever the latest commit on the main branch is) by using:
npm install @headlessui/react@insidersnpm install @headlessui/vue@insiders
Note: The insiders build doesn't follow semver and therefore doesn't guarantee that the APIs will be the same once they are released.
Packages
| Name | Version | Downloads |
|---|---|---|
@headlessui/react |
||
@headlessui/vue |
||
@headlessui/tailwindcss |
Community
For help, discussion about best practices, or feature ideas:
Contributing
If you're interested in contributing to Headless UI, please read our contributing docs before submitting a pull request.
File: packages/@headlessui-vue/README.md
@headlessui/vue
Installation
Please note that this library only supports Vue 3.
npm install @headlessui/vueDocumentation
For full documentation, visit headlessui.com.
Community
For help, discussion about best practices, or feature ideas:
File: packages/@headlessui-tailwindcss/README.md
@headlessui/tailwindcss
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:
| Variant | Inverse variant |
|---|---|
ui-open |
ui-not-open |
ui-checked |
ui-not-checked |
ui-selected |
ui-not-selected |
ui-active |
ui-not-active |
ui-disabled |
ui-not-disabled |
ui-focus-visible |
ui-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:
File: packages/@headlessui-react/README.md
@headlessui/react
Installation
npm install @headlessui/reactDocumentation
For full documentation, visit headlessui.dev.
Community
For help, discussion about best practices, or feature ideas: