tailwindcss-open-variant weekly downloads statistics
By imlian · npm · Tailwind plugins
Open variant for Tailwind CSS
tailwindcss-open-variant has 59 recorded weekly downloads on npm, an increase of 18.0% over the past 30 days, ranking #2739 of 3,247 tracked listings.
About tailwindcss-open-variant
TailwindCSS Open Variant
Open variant for TailwindCSS, to use with the HTML <details> tag and apply styles only when the element is open.
💾 Installation
You can install the package with npm or yarn using the following commands:
# With NPM
npm install tailwindcss-open-variant --save-dev
# With Yarn
yarn add tailwindcss-open-variant --dev
Once installed, require it as a plugin in your Tailwind config file.
plugins: [
// Other plugins...
require('tailwindcss-open-variant')(),
],
Finally, add the open variant as variants to your desired modules.
modules: {
// Other modules...
backgroundColors: ['responsive', 'hover', 'focus', 'open'],
borderColors: ['responsive', 'hover', 'focus', 'group-hover', 'open'],
borderRadius: ['responsive', 'hover', 'group-hover', 'open'],
borderStyle: ['responsive', 'open'],
display: ['responsive', 'open'],
shadows: ['responsive', 'hover', 'focus', 'open'],
textColors: ['responsive', 'hover', 'focus', 'group-hover', 'open'],
},
📝 Usage
Once installed, you can prefix your defined utilities with open: to apply them only when the current details tag, or the parent details tag of the given node, is opened.
You can use this to, for example, display a dropdown menu where the button text changes depending on whether it is open or not:


<details class="inline-block">
<summary class="cursor-pointer select-none align-middle whitespace-no-wrap outline-none rounded-lg focus:outline-none focus:shadow-outline" aria-haspopup="menu">
<span class="button rounded-lg inline-block open:hidden">Open</span>
<span class="button rounded-lg hidden open:inline-block">Close</span>
</summary>
<div class="absolute" role="menu">
<div class="relative bg-white border-t border-b shadow min-w-xs flex flex-col border-t-0 rounded-lg rounded-tl-none p-1 text-left">
<a href="#" class="px-4 py-2 block rounded no-underline focus:shadow-outline text-black hover:bg-grey-lighter">Copy link</a>
<a href="#" class="px-4 py-2 block rounded no-underline focus:shadow-outline text-black hover:bg-grey-lighter">Delete comment</a>
</div>
</div>
</details>
You can also manipulate styles depending on the open state, so as to make the summary fit in with the newly shown element.


<details class="inline-block">
<summary class="cursor-pointer select-none align-middle whitespace-no-wrap outline-none rounded-lg focus:outline-none focus:shadow-outline" aria-haspopup="menu">
<span class="flex items-center cursor-pointer text-sm border-grey rounded-lg py-1 px-2 text-grey-dark focus:shadow hover:shadow open:shadow open:rounded-b-none open:text-grey-darker bg-white p-3">
…
</span>
</summary>
<div class="absolute" role="menu">
<div class="relative bg-white border-t border-b shadow min-w-xs flex flex-col border-t-0 rounded-lg rounded-tl-none p-1 text-left">
<a href="#" class="px-4 py-2 block rounded no-underline focus:shadow-outline text-black hover:bg-grey-lighter">Copy link</a>
<a href="#" class="px-4 py-2 block rounded no-underline focus:shadow-outline text-black hover:bg-grey-lighter">Delete comment</a>
</div>
</div>
</details>
🔖 Changelog
Please see the changelog file for more information on what has changed recently.
⬆️ Upgrading
Please see the upgrading file for details on upgrading from previous versions.
🎉 Contributing
Please see the contributing file and code of conduct for details on contributing to the project.
👷 Credits
♻️ License
The MIT License (MIT). Please see the license file for more information.
Description from the npm listing.
- open
- details
- variant
- plugin
- component
- tailwind
- tailwindcss
- tailwind css
- tailwindcss-plugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (592)Similar npm Tailwind plugins plugins
All 20 tailwindcss-open-variant alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/tailwindcss-open-variant. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.