Skip to content
PluginStats

prettier-plugin-bootstrap weekly downloads statistics

By pierluigilenoci · npm · Prettier plugins

A Prettier plugin for automatic Bootstrap class sorting

View on npm Fresh · Dec 6, 2026

prettier-plugin-bootstrap has 41 recorded weekly downloads on npm, an increase of 70.8% over the past 30 days, ranking #2819 of 3,247 tracked listings.

Weekly downloads
41
Official API · Dec 5, 2026
7-day growth
+46.4%
+13 weekly downloads
30-day growth
+70.8%
+17 weekly downloads
90-day growth
+720%
+36 weekly downloads
Rank
#2819
▼ 93 in 7 days

About prettier-plugin-bootstrap

<p align="center"> <img src=".github/assets/banner.svg" alt="prettier-plugin-bootstrap" width="900"/> </p>

prettier-plugin-bootstrap

CI npm npm downloads Node.js codecov License: MIT

Try it in the playground →

A Prettier plugin that automatically sorts Bootstrap CSS classes following the framework's recommended order.

Works with HTML, JSX/TSX, Vue, Angular, Svelte, and Astro templates.

Why?

  • Consistency — Every file in your project uses the same class order, regardless of who wrote it.
  • Smaller diffs — Sorted classes eliminate noisy reordering in pull requests.
  • Readability — Classes follow Bootstrap's architecture (layout → components → utilities), making it easier to scan what an element does.
  • Zero config — Just add the plugin and format. No ESLint rules to configure, no manual sorting.

Installation

npm install -D prettier-plugin-bootstrap
# or
pnpm add -D prettier-plugin-bootstrap
# or
yarn add -D prettier-plugin-bootstrap

Usage

Add the plugin to your Prettier configuration:

{
  "plugins": ["prettier-plugin-bootstrap"]
}

That's it! Your Bootstrap classes will now be automatically sorted on format.

HTML
<!-- Before -->
<div class="text-center p-3 container bg-primary text-white mb-4 rounded"></div>

<!-- After -->
<div class="container mb-4 p-3 text-center text-white bg-primary rounded"></div>
JSX / TSX
// Before
<button className="btn-lg mt-2 btn btn-primary d-flex align-items-center">Click</button>

// After
<button className="d-flex align-items-center mt-2 btn btn-primary btn-lg">Click</button>
Vue
<!-- Before -->
<div :class="['text-center', 'container', 'p-3']"></div>

<!-- After -->
<div :class="['container', 'p-3', 'text-center']"></div>
Svelte
<!-- Before -->
<div class="text-white p-2 bg-dark d-flex"></div>

<!-- After -->
<div class="d-flex p-2 text-white bg-dark"></div>
Astro
<!-- Before -->
<div class="rounded text-sm p-4 card shadow"></div>

<!-- After -->
<div class="card p-4 rounded shadow text-sm"></div>

Sorting Order

Classes are sorted following Bootstrap's architecture:

  1. Layout — containers, grid, columns
  2. Reboot / Typography — headings, lead, display
  3. Images — img-fluid, figures
  4. Tables — table variants
  5. Forms — form controls, selects, checks
  6. Buttons — btn variants
  7. Components — dropdowns, navs, cards, modals, etc. (alphabetical)
  8. Helpers — clearfix, stacks, visually-hidden
  9. Utilities — following the order in scss/_utilities.scss

Within each group, responsive variants (sm, md, lg, xl, xxl) sort after the base class.

Unknown classes are preserved in their original relative order and placed after all known Bootstrap classes.

Options

OptionTypeDefaultDescription
bootstrapAttributesstring[][]Additional HTML attributes to sort (beyond class and className). Supports regex patterns (e.g. /^data-class/).
bootstrapFunctionsstring[][]Function names whose arguments are class lists (e.g. clsx, classNames)
bootstrapPreserveWhitespacebooleanfalsePreserve original whitespace between classes instead of normalizing to single spaces
bootstrapPreserveDuplicatesbooleantrueKeep duplicate class names. Set to false to remove duplicates
bootstrapVersionint5Bootstrap version (4 or 5)
bootstrapSortTemplateLiteralsbooleantrueSort static class segments inside JSX template literals that contain expressions. Set to false to skip them
bootstrapAttributes

Sort classes in custom attributes beyond class / className:

<!-- .prettierrc: { "bootstrapAttributes": ["ngClass"] } -->

<!-- Before -->
<div [ngClass]="'text-center p-3 container'"></div>

<!-- After -->
<div [ngClass]="'container p-3 text-center'"></div>
bootstrapFunctions

Sort class strings passed to utility functions like clsx:

// .prettierrc: { "bootstrapFunctions": ["clsx"] }

// Before
clsx('btn-lg', 'mt-2', 'btn', 'btn-primary')

// After
clsx('mt-2', 'btn', 'btn-primary', 'btn-lg')
bootstrapPreserveWhitespace

Keep original whitespace between classes (default: normalise to single spaces):

<!-- .prettierrc: { "bootstrapPreserveWhitespace": true } -->

<!-- Before -->
<div class="p-3   container  mt-2"></div>…

Description from the npm listing.

  • prettier
  • prettier-plugin
  • plugin
  • bootstrap
  • bootstrap5
  • bootstrap-5
  • css
  • class
  • class-sorter
  • class-order
  • sorting
  • sort-classes
  • formatter
  • html
  • jsx
  • react
  • vue
  • svelte
  • astro
  • angular

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-bootstrap weekly downloads on npm, last 90 days: 41 weekly downloads as of Dec 5, 2026, +720% over 90 days.prettier-plugin-bootstrapWeekly downloads on npm · Last 90 days41downloads / week+720% over 90 days010203040506070Sep 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-bootstrap weekly downloads on npm, last 90 days: 41 weekly downloads as of Dec 5, 2026, +720% over 90 days.

7/30/90-day growth

prettier-plugin-bootstrap weekly downloads growth on npm: +46.4% over 7 days, +70.8% over 30 days, +720% over 90 days.prettier-plugin-bootstrapWeekly downloads growth on npm41downloads / week now7-day growth+13 weekly downloads+46.4%30-day growth+17 weekly downloads+70.8%90-day growth+36 weekly downloads+720%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
prettier-plugin-bootstrap weekly downloads growth on npm: +46.4% over 7 days, +70.8% over 30 days, +720% over 90 days.

Ranking history

prettier-plugin-bootstrap npm ranking history: currently #2819 (by weekly downloads).prettier-plugin-bootstrapnpm ranking · by weekly downloads · Last 90 days#2819current rank#1800#2000#2200#2400#2600#2800#3000Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
prettier-plugin-bootstrap npm ranking history: currently #2819 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 142, #1 (overall #2,821)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins267 listings · 14 pages · page 7, #6 (overall #126)
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 (170)
Recent weekly downloads observations for prettier-plugin-bootstrap
Date (UTC)Weekly downloadsChange vs. previous
410
41+2
39+21
180
18+3
15+2
13-15
28-13
41+2
39+2
37-10
47-2
49+1
48—

Similar npm Prettier plugins plugins

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