@culur/prettier-plugin-tailwindcss-group weekly downloads statistics
By culur · npm · Prettier plugins
Prettier plugin to automatically format and wrap long className attributes
@culur/prettier-plugin-tailwindcss-group has 15 recorded weekly downloads on npm, an increase of 275% over the past 30 days, ranking #3051 of 3,247 tracked listings.
About @culur/prettier-plugin-tailwindcss-group
@culur/prettier-plugin-tailwindcss-group
Prettier plugin to automatically group, format, and simplify Tailwind CSS class names across JSX attributes, object properties, and CVA variant definitions.
✨ Features
This plugin enforces a clean and consistent structure for Tailwind CSS classes. It provides:
- Automatic Grouping: Automatically breaks down long class strings into logically grouped arguments by utility category (Layout, Typography, Visuals, etc.).
- Multi-Target Support: Formats JSX attributes (
className,wrapperClassName), object properties (className,wrapperclassName), andcva()parameters fromclass-variance-authority(commonly used inshadcn/ui). - Redundancy Simplification: Flattens unnecessary wrapper functions into pure strings if they are under the threshold.
- Comment Preservation: Safely detects and preserves code comments (
//and/* ... */) by bailing out on commented nodes to avoid Prettier"Comment was not printed"errors. - Idempotency & Compatibility: Strictly manipulates the Prettier AST. The output is fully compliant with standard Prettier formatting and integrates flawlessly with
prettier-plugin-tailwindcss.
💿 Installation
Add @culur/prettier-plugin-tailwindcss-group and prettier-plugin-tailwindcss to your project. prettier-plugin-tailwindcss is a required peer dependency used to resolve official Tailwind CSS compiler sorting and variant hierarchies.
[!NOTE] No need to install
tailwind-merge: The requiredtailwind-mergeengine is already bundled directly inside@culur/prettier-plugin-tailwindcss-group. You do not need to installtailwind-mergeas a separate dependency unless your application code directly imports utility functions liketwMerge()orcn().
# Using npm
npm install @culur/prettier-plugin-tailwindcss-group prettier-plugin-tailwindcss --save-dev
# Using pnpm
pnpm install @culur/prettier-plugin-tailwindcss-group prettier-plugin-tailwindcss --save-dev
# Using yarn
yarn add @culur/prettier-plugin-tailwindcss-group prettier-plugin-tailwindcss --dev
# Using bun
bun add @culur/prettier-plugin-tailwindcss-group prettier-plugin-tailwindcss --dev
Note: You also need prettier (>=3.0.0) installed in your project.
📖 Usage & Integration
Add to your .prettierrc configuration:
{
"plugins": [
"@culur/prettier-plugin-tailwindcss-group",
"prettier-plugin-tailwindcss"
],
"classNameThreshold": 10,
"modifierThreshold": 2,
"tailwindFunctions": ["cn"]
}
Both plugins share the tailwindFunctions configuration option, so helper functions like cn() or clsx() are sorted and grouped seamlessly.
⚙️ Options
| Option | Type | Default | Description |
|---|---|---|---|
classNameThreshold | int | 10 | Threshold of class names (split by whitespace) to trigger wrapping. |
modifierThreshold | int | 2 | Threshold of modifier/variant classes within a category before splitting into separate lines. |
tailwindFunctions | string[] | ["cn"] | List of helper function names. The first element is used as default wrapper function. Note: tailwindFunctions is also an official option of prettier-plugin-tailwindcss. |
📐 Formatting Rules & Concepts
This plugin inspects AST nodes to find valid styling targets and applies formatting rules.
🔠 Representation Modes
Depending on the target context and rule thresholds, class strings are represented in one of the following AST forms:
-
StringLiteral: A raw static string literal
"class-1 class-2".// JSX Attribute <div className="flex items-center" />; // CVA Parameter const button = cva('flex items-center'); -
ExpressionStringLiteral: A JSX expression container wrapping a single string literal
{"class-1 class-2"}(JSX Attributes only).<div className={'flex items-center'} /> -
ExpressionCall: A helper function call such as
{cn('class-1 class-2')}(JSX Attributes) orcn('class-1 class-2')(Object Properties / CVA Parameters).// JSX Attribute Expression Call <div className={cn('flex items-center')} />; // Object Property Expression Call const config = { className: cn('flex items-center') }; -
ExpressionArrayString: An array literal containing string items
['class-1', 'class-2'](used in CVA parameters).const button = cva([ 'flex items-center justify-center', 'bg-white shadow-sm', ]);
---…
Description from the npm listing.
- culur
- prettier
- prettier-plugin
- classnames
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 @culur/prettier-plugin-tailwindcss-group 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/@culur/prettier-plugin-tailwindcss-group. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.