prettier-plugin-tailwind-align weekly downloads statistics
By sudhirgadpayle · npm · Prettier plugins
Prettier plugin that sorts Tailwind CSS classes and aligns object properties — in one pass.
prettier-plugin-tailwind-align has 7 recorded weekly downloads on npm, unchanged over the past 30 days, ranking #3189 of 3,247 tracked listings.
About prettier-plugin-tailwind-align
prettier-plugin-tailwind-align
One Prettier plugin. Two formatters. Zero conflicts.
Sorts Tailwind CSS utility classes and vertically aligns object properties — in a single pass.
</div>Table of Contents
- Why this exists
- Installation
- Quick start
- Options
- What gets aligned
- Full example
- Migrating from two separate plugins
- Local development
- Compatibility
- License
Why this exists
Prettier only allows one plugin to own a given parser hook (e.g. parsers["typescript"]).
When prettier-plugin-tailwindcss and @huggingface/prettier-plugin-vertical-align are both
listed in "plugins", whichever comes last silently wins the hook — breaking the other one
with no error or warning.
The common workaround is a two-pass setup: run Tailwind sorting in one Prettier pass, alignment in another. This is fragile, slow, and ties your CI to a specific script order.
prettier-plugin-tailwind-align eliminates the problem entirely. It composes both behaviours
internally so Prettier sees exactly one plugin, runs one pass, and both Tailwind class sorting
and object alignment happen in the correct order — guaranteed.
Installation
# npm
npm install --save-dev prettier-plugin-tailwind-align
# pnpm
pnpm add -D prettier-plugin-tailwind-align
# yarn
yarn add -D prettier-plugin-tailwind-align
# bun
bun add --dev prettier-plugin-tailwind-align
Peer dependencies —
prettierandprettier-plugin-tailwindcssmust be installed separately (they are not bundled).npm install --save-dev prettier prettier-plugin-tailwindcss
Quick start
Add the plugin to your .prettierrc (or prettier.config.js / prettier.config.ts):
{
"plugins": ["prettier-plugin-tailwind-align"],
"tailwindStylesheet": "./app/globals.css",
"alignInGroups": "always"
}
That's it. Remove any separate prettier-plugin-tailwindcss or
@huggingface/prettier-plugin-vertical-align entries — this plugin replaces both.
Options
All options from prettier-plugin-tailwindcss
are fully supported and passed through unchanged — tailwindConfig, tailwindStylesheet,
tailwindFunctions, tailwindAttributes, and so on.
In addition, this plugin adds the following options:
Complete .prettierrc example
{
"plugins": ["prettier-plugin-tailwind-align"],
"tailwindStylesheet": "./app/globals.css",
"alignInGroups": "always",
"tailwindAlignAttributes": ["myClass", "triggerClass"],
"tailwindAlignFunctions": ["myMerge", "styled"],
"tailwindAlignWidth": 0,
"tailwindAlignGroups": false,
"tailwindAlignMinLength": 0,
"tailwindAlignObjectValues": true
}
Option Reference
| Option | Type | Default | Description |
|---|---|---|---|
alignInGroups | "never" | "always" | "never" | Alignment scope inside object blocks |
tailwindAlignAttributes | string[] | [] | Extra JSX attribute names to treat as class strings |
tailwindAlignFunctions | string[] | [] | Extra function names whose arguments are class strings |
tailwindAlignWidth | number | 0 | Column width before wrapping; 0 = inherit printWidth |
tailwindAlignGroups | boolean | false | Group classes by Tailwind category (reserved, future feature) |
tailwindAlignMinLength | number | 0 | Min class string length to trigger formatting; 0 = always |
tailwindAlignObjectValues | boolean | true | Vertically align values in object class maps |
alignInGroups
Controls how alignment groups are computed inside object literals, interfaces, type literals, and class bodies.
| Value | Default | Description |
|---|---|---|
"never" | ✅ | Every alignable property in the same block shares one alignment column. |
"always" | A blank line starts a new independent group. Each group aligns to its own column. |
"never" — whole-block alignment
All properties align to the longest key in the entire block.
const palette = {
red: "#ef4444",
green: "#22c55e",
blue: "#3b82f6",
darkGreen: "#166534",
};
"always" — group-level alignment
A blank line starts a new independent alignment group.
const palette = {
red: "#ef4444",
green: "#22c55e",
blue: "#3b82f6",
darkRed: "#991b1b",
darkGreen: "#166534",
darkBlue: "#1e3a8a",
};
tailwindAlignAttributes
string[]· default:[]
Extra JSX attribute names (beyond the built-in list) that the plugin should treat as Tailwind class strings.
Built-in list already includes: className, class, wrapperClass, containerClass,
buttonClass, labelClass, inputClass, and 20+ more common names.
{ "tailwindAlignAttributes": ["myClass", "triggerClass", "overlayClass"] }
// Before
<Modal myClass=" flex flex-col gap-4 " />…
Description from the npm listing.
- prettier
- prettier-plugin
- tailwind
- tailwindcss
- align
- vertical-align
- object-properties
- format
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 (170)Similar npm Prettier plugins plugins
All 20 prettier-plugin-tailwind-align 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/prettier-plugin-tailwind-align. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.