Skip to content
PluginStats

prettier-plugin-unocss weekly downloads statistics

By hexlabelposition · npm · Prettier plugins

Unofficial Prettier plugin that sorts UnoCSS utilities using your own uno.config, in the same order as the official ESLint rule.

View on npm Fresh · Dec 6, 2026

prettier-plugin-unocss has 31 recorded weekly downloads on npm, a change of -22.5% over the past 7 days, ranking #2896 of 3,247 tracked listings.

Weekly downloads
31
Official API · Dec 5, 2026
7-day growth
-22.5%
-9 weekly downloads
30-day growth
—
Insufficient history
90-day growth
—
Insufficient history
Rank
#2896
▼ 235 in 7 days

About prettier-plugin-unocss

prettier-plugin-unocss

A Prettier plugin that sorts UnoCSS utilities, using your own uno.config. Custom rules, shortcuts and presets are sorted correctly, in the same order as the UnoCSS ESLint rule.

- <div className="shadow md:p-8 p-4 my-custom rounded-lg bg-white flex">
+ <div className="my-custom flex rounded-lg bg-white p-4 shadow md:p-8">

Think prettier-plugin-tailwindcss, but for UnoCSS.

[!NOTE] Unofficial, with the official order. This is a community plugin, not made or endorsed by the UnoCSS team. The order itself comes from UnoCSS: classes are sorted by sortRules from @unocss/core, the same function the UnoCSS ESLint rule uses.

SectionWhat's inside
WhyWhat the plugin is for
InstallationInstall and enable it
What gets sortedLanguages, attributes and functions
How classes are orderedThe order, duplicates, line breaks
Using with other Prettier pluginsPlugin order, Svelte, Astro, import sorters
OptionsunoConfig, unoAttributes, unoFunctions, unoVariables
LimitationsWhat isn't sorted or needs care
PerformanceCost of the first and every next file
DevelopmentScripts and tests
CreditsWhere the code comes from
LicenseMIT

Why

UnoCSS already sorts classes with the ESLint rule @unocss/order. This plugin brings the same order to Prettier, for projects that format with Prettier and want classes sorted on save, without running ESLint for it.

Installation

Requires Node.js 22.18 or later and Prettier 3.

pnpm add -D prettier prettier-plugin-unocss
# or
npm install -D prettier prettier-plugin-unocss
// prettier.config.js

/**
 * @see https://prettier.io/docs/configuration
 * @type {import("prettier").Config}
 */
const config = {
  plugins: ['prettier-plugin-unocss'],
}

export default config

That's it. The plugin finds uno.config.* (or unocss.config.*) next to each file or in a parent directory, so monorepos with several configs work. A file without a config is left untouched. If the config fails to load, Prettier reports the error with the config path, instead of silently not sorting.

In an editor, the config is loaded again when it changes, so there is no need to restart Prettier.

What gets sorted

WhereWhat
JS / TS / JSX / TSXclass and className, clsx / cn / cx / classnames / tv / cva calls, class variables (const clsButton = '…')
Vueclass, :class (strings, arrays, objects), attributify (<div p-4 flex>)
HTMLclass
Svelteclass="…", class={…}; class:name directives are left alone
Astroclass, class:list

<script> blocks and the Astro frontmatter are sorted like any JS/TS file.

Inside class functions and attributes, the plugin also follows conditionals (on ? 'a b' : 'c'), && / || / ??, arrays, object values, template literals, and tagged templates whose tag is in unoFunctions (add tw there for tw`…` ). Object keys are classes in clsx-like functions (clsx({ 'p-4 flex': on })), but never in tv / cva, where they are names.

Attributify utilities are sorted only when presetAttributify is in your config.

How classes are ordered

  1. Classes UnoCSS doesn't know come first, in their original order.
  2. Then utilities, in the order of the rules that match them in your config.
  3. Utilities with variants (hover:, md:) come after the ones without; more variants, further back.
  4. Variant groups hover:(a b) are sorted inside and stay grouped.

Icons from presetIcons count as unknown classes and go first, as with the ESLint rule: icon collections are not loaded for sorting.

Like eslint --fix with the UnoCSS rule, the plugin keeps duplicate classes (p-4 flex p-4 → flex p-4 p-4) and puts a class list split over several lines on one line.…

Description from the npm listing.

  • class-sorting
  • css
  • formatter
  • prettier
  • prettier-plugin
  • unocss
  • unocss-plugin
  • typescript

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-unocss weekly downloads on npm, last 90 days: 31 weekly downloads as of Dec 5, 2026.prettier-plugin-unocssWeekly downloads on npm · Last 90 days31downloads / week0100200300400500600Sep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
prettier-plugin-unocss weekly downloads on npm, last 90 days: 31 weekly downloads as of Dec 5, 2026.

7/30/90-day growth

prettier-plugin-unocss weekly downloads growth on npm: -22.5% over 7 days, 30-day growth unavailable, 90-day growth unavailable.prettier-plugin-unocssWeekly downloads growth on npm31downloads / week now7-day growth-9 weekly downloads-22.5%30-day growth+31 weekly downloadsInsufficient history90-day growth+31 weekly downloadsInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
prettier-plugin-unocss weekly downloads growth on npm: -22.5% over 7 days, 30-day growth unavailable, 90-day growth unavailable.

Ranking history

prettier-plugin-unocss npm ranking history: currently #2896 (by weekly downloads).prettier-plugin-unocssnpm ranking · by weekly downloads · Last 90 days#2896current rank#1600#1800#2000#2200#2400#2600#2800#3000Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankNov 26, 2026 – Dec 6, 2026 · 11 observations · Updated Dec 5, 2026pluginstats.com
prettier-plugin-unocss npm ranking history: currently #2896 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 145, #18 (overall #2,898)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins267 listings · 14 pages · page 8, #11 (overall #151)
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 (128)
Recent weekly downloads observations for prettier-plugin-unocss
Date (UTC)Weekly downloadsChange vs. previous
31+12
19-8
27-4
31-4
35-3
38+1
37-3
40-8
48-3
51-31
82-440
522+5
5170
517—

Similar npm Prettier plugins plugins

All 20 prettier-plugin-unocss 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-unocss. First seen Nov 26, 2026; last successful collection Dec 6, 2026. See the methodology.