
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
@kobalte/tailwindcss
Advanced tools
A TailwindCSS plugin for styling Kobalte components with data-* attributes by using modifiers like ui-expanded:*
A TailwindCSS plugin for styling Kobalte components with data-*
attributes by using modifiers like ui-expanded:*
.
npm install -D @kobalte/tailwindcss
# or
yarn add -D @kobalte/tailwindcss
# or
pnpm add -D @kobalte/tailwindcss
Add the plugin to your tailwind.config.js
:
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [],
theme: {
extend: {},
},
plugins: [
// default prefix is "ui"
require("@kobalte/tailwindcss"),
// or with a custom prefix:
require("@kobalte/tailwindcss")({ prefix: "kb" }),
],
};
Style your component:
import { Popover } from "@kobalte/core";
export const MyPopover = () => (
<Popover>
<Popover.Trigger class="ui-disabled:bg-slate-100">Open</Popover.Trigger>
<Popover.Content class="ui-expanded:shadow-md">...</Popover.Content>
</Popover>
);
You can use the following modifiers:
Modifier | Inverse modifier |
---|---|
ui-valid | ui-not-valid |
ui-invalid | ui-not-invalid |
ui-required | ui-not-required |
ui-disabled | ui-not-disabled |
ui-readonly | ui-not-readonly |
ui-checked | ui-not-checked |
ui-indeterminate | ui-not-indeterminate |
ui-selected | ui-not-selected |
ui-pressed | ui-not-pressed |
ui-expanded | ui-not-expanded |
ui-highlighted | ui-not-highlighted |
ui-current | ui-not-current |
ui-placeholder-shown | ui-not-placeholder-shown |
It's also possible to use inverse modifiers in the form of ui-not-*
, group and peer modifiers in the form of ui-group-*
and ui-peer-*
.
For full documentation, visit kobalte.dev.
This plugin is an adaptation of @headlessui/tailwindcss, MIT Licensed, Copyright (c) 2020 Tailwind Labs.
All notable changes are described in the CHANGELOG.md file.
FAQs
A TailwindCSS plugin for styling Kobalte components with data-* attributes by using modifiers like ui-expanded:*
The npm package @kobalte/tailwindcss receives a total of 1,370 weekly downloads. As such, @kobalte/tailwindcss popularity was classified as popular.
We found that @kobalte/tailwindcss demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.