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 · Oct 17, 2026

prettier-plugin-bootstrap has 8 recorded weekly downloads on npm, a decrease of 77.8% over the past 30 days.

It ranks #1948 of 2,251 tracked npm listings by weekly downloads.

Over 90 days, weekly downloads changed by -57.9%.

PluginStats has 121 daily observations since Jun 19, 2026; the latest is from Oct 17, 2026.

Weekly downloads
8
Official API · Oct 17, 2026
7-day growth
-38.5%
-5 weekly downloads
30-day growth
-77.8%
-28 weekly downloads
90-day growth
-57.9%
-11 weekly downloads
Rank
#1948
Among tracked npm listings

About prettier-plugin-bootstrap

prettier-plugin-bootstrap

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

Usage

Add the plugin to your Prettier configuration:

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

HTML

JSX / TSX

Vue

Svelte

Astro

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

| Option | Type | Default | Description |

| bootstrapAttributes | string[] | [] | Additional HTML attributes to sort (beyond class and className). Supports regex patterns (e.g. /^data-class/). | | bootstrapFunctions | string[] | [] | Function names whose arguments are class lists (e.g. clsx, classNames) | | bootstrapPreserveWhitespace | boolean | false | Preserve original whitespace between classes instead of normalizing to single spaces | | bootstrapPreserveDuplicates | boolean | true | Keep duplicate class names. Set to false to remove duplicates | | bootstrapVersion | int | 5 | Bootstrap version (4 or 5) | | bootstrapSortTemplateLiterals | boolean | true | Sort 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:

bootstrapFunctions

Sort class strings passed to utility functions like clsx:

bootstrapPreserveWhitespace

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

bootstrapPreserveDuplicates

Remove duplicate class names by setting to false (default: true, keep duplicates):

bootstrapSortTemplateLiterals

By default, static class segments inside JSX template literals with expressions are sorted independently:

Set to false to restore the pre-v0.4.0 behaviour and skip template literals with expressions entirely:

Full example

TypeScript Configuration

For type-safe configuration, use JSDoc annotations:

Regex Attributes

You can use regex patterns in bootstrapAttributes to match dynamic attribute names:

Patterns must be wrapped in forward slashes. Optional flags (i, g, etc.) are supported: /^data-class/i.

File-Level Ignore

Add a comment at the top of a file to skip Bootstrap class sorting for the entire file:

For JS/TS files:

Or block comment style:

Inline Ignore (single element)

To skip sorting for a single element while keeping sorting active for the rest of the file, add an ignore comment on the line before the element:

For JS/TS files:

Public Sorting API

For programmatic use (linters, codemods, build tools), import the sorter directly:

Editor Integration

No editor-specific configuration is needed — the plugin works through Prettier. Enable "Format on Save" in your editor and Prettier will sort classes automatically.

VS Code

1. Install the Prettier - Code formatter extension. 2. Add to .vscode/settings.json:

WebStorm / IntelliJ

Go to Settings → Languages & Frameworks → Prettier and enable Run on save.

Neovim

Use conform.nvim or null-ls with Prettier as the formatter, then enable format-on-save in your config.

Supported Parsers

• html — HTML files • vue — Vue single-file components • angular — Angular templates • babel / babel-ts / typescript — JSX/TSX files • acorn / meriyah — Alternative JS parsers • svelte — Svelte components (requires prettier-plugin-svelte) • astro — Astro components (requires prettier-plugin-astro)

Svelte

When using with prettier-plugin-svelte, list prettier-plugin-bootstrap after prettier-plugin-svelte in your config:

Astro

When using with prettier-plugin-astro, list prettier-plugin-bootstrap after prettier-plugin-astro in your config so it can wrap the Astro parser:

Plugin Compatibility

This plugin works alongside other Prettier plugins. Load order matters — prettier-plugin-bootstrap should come last so it can wrap the parsers registered by other plugins.

| Plugin | Compatible | Load Order |

| prettier-plugin-svelte | Yes | svelte first | | prettier-plugin-astro | Yes | astro first | | prettier-plugin-tailwindcss | N/A | Use one or the other (both sort classes) | | prettier-plugin-organize-imports | Yes | Any order | | @trivago/prettier-plugin-sort-imports | Yes | Any order |

FAQ

Does class sorting affect line wrapping?

Yes. Reordering classes changes the string length, which may cause Prettier to wrap lines differently based on your printWidth setting. This is expected — the formatting is still deterministic and consistent.

Can I use this with Tailwind CSS?

This plugin is designed specifically for Bootstrap's class system. If you use Tailwind CSS, use prettier-plugin-tailwindcss instead. They should not be used together as they have conflicting sort orders.

Development

Compatibility

• Prettier >= 3.0.0 • Node.js >= 20.19 • Bootstrap 5 (class order)

License

MIT

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

Where prettier-plugin-bootstrap sits in the listing

Each band is one page of 20. Weekly downloads on a log 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.

All npm2,248 listings · 113 pages · page 98, #9 (overall #1949)
All npm: every listing in weekly downloads order
PNG SVG
Prettier plugins241 listings · 13 pages · page 6, #8 (overall #108)
Prettier plugins: every listing in weekly downloads order
PNG SVG

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

prettier-plugin-bootstrap weekly downloads on npm, last 90 days: 8 weekly downloads as of Oct 17, 2026, -57.9% over 90 days.prettier-plugin-bootstrapWeekly downloads on npm · Last 90 days8downloads / week-57.9% over 90 days010203040506070Jul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 20, 2026 – Oct 17, 2026 · 90 observations · Updated Oc…pluginstats.com
prettier-plugin-bootstrap weekly downloads on npm, last 90 days: 8 weekly downloads as of Oct 17, 2026, -57.9% over 90 days.
PNG SVG

7/30/90-day growth

prettier-plugin-bootstrap weekly downloads growth on npm: -38.5% over 7 days, -77.8% over 30 days, -57.9% over 90 days.prettier-plugin-bootstrapWeekly downloads growth on npm8downloads / week now7-day growth-5 weekly downloads-38.5%30-day growth-28 weekly downloads-77.8%90-day growth-11 weekly downloads-57.9%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
prettier-plugin-bootstrap weekly downloads growth on npm: -38.5% over 7 days, -77.8% over 30 days, -57.9% over 90 days.
PNG SVG

Ranking history

prettier-plugin-bootstrap npm ranking history: currently #1948 (by weekly downloads).prettier-plugin-bootstrapnpm ranking · by weekly downloads · Last 90 days#1948current rank#1946#1947#1948#1949#1950Jul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18rankOct 18, 2026 – Oct 18, 2026 · 1 observations · Updated Oct 17, 2026pluginstats.com
prettier-plugin-bootstrap npm ranking history: currently #1948 (by weekly downloads).
PNG SVG

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.

Recent observations

Full history (121)
Recent weekly downloads observations for prettier-plugin-bootstrap
Date (UTC)Weekly downloadsChange vs. previous
80
8+1
7-3
100
100
10-6
16+3
130
13-1
14-6
20-6
26-4
30+3
27—

Similar npm Prettier plugins plugins

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 Oct 18, 2026. See the methodology.