Skip to content
PluginStats

prettier-plugin-tailwind-variants weekly downloads statistics

By tianenpang · npm · Prettier plugins

A Prettier plugin for Tailwind Variants that formats class arrays while preserving structure, then sorts them with prettier-plugin-tailwindcss

View on npm Fresh · Oct 18, 2026

prettier-plugin-tailwind-variants has 8 recorded weekly downloads on npm, a decrease of 50.0% over the past 30 days, ranking #2089 of 2,322 tracked listings.

Weekly downloads
8
Official API · Oct 18, 2026
7-day growth
-33.3%
-4 weekly downloads
30-day growth
-50.0%
-8 weekly downloads
90-day growth
—
Insufficient history
Rank
#2089
Among tracked npm listings

About prettier-plugin-tailwind-variants

prettier-plugin-tailwind-variants

<img src="./.github/banner.jpg" alt="prettier-plugin-tailwind-variants" />

A Prettier plugin for Tailwind Variants. Formats tv() class arrays while preserving structure, then sorts with prettier-plugin-tailwindcss.

npm version License: MIT CI

Installation

pnpm add -D prettier prettier-plugin-tailwindcss@^0.8.0 prettier-plugin-tailwind-variants
// prettier.config.js
import * as tailwindcss from 'prettier-plugin-tailwindcss';
import tailwindVariants from 'prettier-plugin-tailwind-variants';

/** @type {import('prettier').Config} */
export default {
  plugins: [tailwindVariants(tailwindcss)],
  tailwindFunctions: ['tv'],
  tvFunctions: ['tv']
};

Must be composed with prettier-plugin-tailwindcss as above.

Options

OptionDefaultDescription
tvFunctions['tv']Callee names to format. Keep tailwindFunctions in sync for string sorting.
tvUnwrapSingleClassArraystrueUnwrap nested single-class arrays into the parent sort pool. Ignored when grouping or flattening.
tvGroupByModifiersfalseSplit tokens into one string per modifier group (base, hover, dark, …).
tvModifierGroupOrderbuilt-inGroup id order when grouping is on. Ignored when grouping is off.
tvFlattenToStringfalseFlatten arrays / nests into a single class string. Ignored for final shape when grouping is on.
tvRemoveEmptyClassestrueRemove empty / whitespace-only class strings and empty arrays.
tvGroupByBreakpointsfalseWhen grouping, put each breakpoint (sm, md, …) in its own group. Ignored when grouping is off.

Shape priority: tvGroupByModifiers → else tvFlattenToString → else preserve structure (+ unwrap).

// tvGroupByModifiers: true
base: ['dark:bg-black', 'px-4', 'hover:bg-red-500', 'py-2'];
// →
base: ['px-4 py-2', 'hover:bg-red-500', 'dark:bg-black'];

// tvFlattenToString: true
base: ['text-white', ['py-2', 'px-4'], 'rounded-lg'];
// →
base: 'rounded-lg px-4 py-2 text-white';

Formatting

// Before
tv({
  base: ['text-white', ['py-2', 'px-4'], 'rounded-lg']
});

// After (default structure mode)
tv({
  base: ['rounded-lg', ['px-4', 'py-2'], 'text-white']
});

Covers base, slots, variants, compoundVariants / compoundSlots (class / className). JS/TS and <script> regions (Vue, Svelte, Astro, HTML, …); CSS is left alone. Framework parsers need their own Prettier plugins.

Editor IntelliSense

Prefer key-scoped classRegex over classFunctions: ["tv"] so conditions and defaultVariants are skipped. Copy from .vscode/settings.json and enable "editor.quickSuggestions": { "strings": "on" }.

{
  "tailwindCSS.experimental.classRegex": [
    ["\\b(?:base|class|className)\\s*:\\s*['\"`]([^'\"`]*)['\"`]"],
    [
      "\\b(?:base|class|className)\\s*:\\s*(\\[(?:[^\\[\\]]|\\[(?:[^\\[\\]]|\\[(?:[^\\[\\]]|\\[[^\\[\\]]*\\])*\\])*\\])*\\])",
      "['\"`]([^'\"`]*)['\"`]"
    ],
    ["\\b(?:class|className)\\s*:\\s*(\\{(?:[^{}]|\\{[^{}]*\\})*\\})", "['\"`]([^'\"`]*)['\"`]"],
    ["\\bslots\\s*:\\s*(\\{(?:[^{}]|\\{[^{}]*\\})*\\})", "['\"`]([^'\"`]*)['\"`]"],
    [
      "\\bvariants\\s*:\\s*(\\{(?:[^{}]|\\{(?:[^{}]|\\{(?:[^{}]|\\{[^{}]*\\})*\\})*\\})*\\})",
      "['\"`]([^'\"`]*)['\"`]"
    ]
  ]
}

Limitations

  • Static strings and literal arrays only
  • Dynamic values skip that array
  • Peers: prettier@^3.0.0, prettier-plugin-tailwindcss@^0.8.0

Community

Contributing · Code of Conduct · Security · Support

License

MIT

Description from the npm listing.

  • prettier
  • prettier-plugin
  • tailwind
  • tailwindcss
  • tailwind-variants
  • formatting
  • class-sorting
  • variants

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

prettier-plugin-tailwind-variants weekly downloads on npm, last 90 days: 8 weekly downloads as of Oct 18, 2026.prettier-plugin-tailwind-variantsWeekly downloads on npm · Last 90 days8downloads / week0100200300400500600Jul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
prettier-plugin-tailwind-variants weekly downloads on npm, last 90 days: 8 weekly downloads as of Oct 18, 2026.

7/30/90-day growth

prettier-plugin-tailwind-variants weekly downloads growth on npm: -33.3% over 7 days, -50.0% over 30 days, 90-day growth unavailable.prettier-plugin-tailwind-variantsWeekly downloads growth on npm8downloads / week now7-day growth-4 weekly downloads-33.3%30-day growth-8 weekly downloads-50.0%90-day growth+8 weekly downloadsInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
prettier-plugin-tailwind-variants weekly downloads growth on npm: -33.3% over 7 days, -50.0% over 30 days, 90-day growth unavailable.

Ranking history

prettier-plugin-tailwind-variants npm ranking history: currently #2089 (by weekly downloads).prettier-plugin-tailwind-variantsnpm ranking · by weekly downloads · Last 90 days#2089current rank#600#800#1000#1200#1400#1600#1800#2000#2200Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 17, 2026 – Oct 20, 2026 · 4 observations · Updated Oct 18, 2026pluginstats.com
prettier-plugin-tailwind-variants npm ranking history: currently #2089 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,161 shown · page 105, #13 (overall #2,093)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins244 listings · 13 pages · page 7, #15 (overall #135)
Prettier plugins: every listing in weekly downloads order

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 (544)
Recent weekly downloads observations for prettier-plugin-tailwind-variants
Date (UTC)Weekly downloadsChange vs. previous
8+1
7-6
130
13-3
160
160
16+4
120
12+6
6-2
8+3
5-4
9-3
12—

Similar npm Prettier plugins plugins

All 20 prettier-plugin-tailwind-variants alternatives

Data 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/prettier-plugin-tailwind-variants. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.