Skip to content
PluginStats

@chazuk/prettier-plugin-angular-sort-attributes weekly downloads statistics

By chazuk · npm · Prettier plugins

Prettier plugin that sorts Angular HTML template attributes

View on npm Fresh · Dec 6, 2026

@chazuk/prettier-plugin-angular-sort-attributes has 108 recorded weekly downloads on npm, an increase of 11.3% over the past 30 days, ranking #2611 of 3,247 tracked listings.

Weekly downloads
108
Official API · Dec 5, 2026
7-day growth
+42.1%
+32 weekly downloads
30-day growth
+11.3%
+11 weekly downloads
90-day growth
+80.0%
+48 weekly downloads
Rank
#2611
▼ 66 in 7 days

About @chazuk/prettier-plugin-angular-sort-attributes

@chazuk/prettier-plugin-angular-sort-attributes

A Prettier plugin that sorts attributes on Angular HTML template elements into a consistent, readable order.

Installation

npm install --save-dev @chazuk/prettier-plugin-angular-sort-attributes

Configuration

Add the plugin to your Prettier config:

{
  "plugins": ["@chazuk/prettier-plugin-angular-sort-attributes"]
}

Works on .html files and inline template strings inside TypeScript component files.

Default attribute order

Attributes are grouped and sorted in this order:

#GroupExamples
1Structural directives*ngIf, *ngFor, *ngTemplateOutlet
2Animation triggers@fade, [@slide]="state"
3Element references#myComponent
4Standard HTML attributesclass, id, style, aria-*, data-*
5Non-interpolated string inputsfoo="bar"
6Property bindings[value]="theValue"
7Two-way bindings[(ngModel)]="email"
8Event bindings(click)="onClick()"

Within each group, attributes are sorted alphabetically.

<!-- before -->
<my-app-component
  (click)="onClick($event)"
  [(ngModel)]="fooBar"
  class="foo"
  #myComponent
  [bar]="theBar"
  @fade
  foo="bar"
  *ngIf="shouldShow"
  (someEvent)="onSomeEvent($event)"
/>

<!-- after -->
<my-app-component
  *ngIf="shouldShow"
  @fade
  #myComponent
  class="foo"
  foo="bar"
  [bar]="theBar"
  [(ngModel)]="fooBar"
  (click)="onClick($event)"
  (someEvent)="onSomeEvent($event)"
/>

Custom order

Use angularSortAttributesOrder to override the ordering with group tokens, specific attribute names, or a mix of both.

Available group tokens:

TokenCovers
<STRUCTURAL_DIRECTIVES>*ngIf, *ngFor, …
<ANIMATION_TRIGGERS>@fade, [@slide]="state", …
<ELEMENT_REFS>#myRef
<HTML_ATTRIBUTES>class, id, aria-*, data-*, …
<INPUTS>foo="bar", [value]="v" (string inputs + property bindings)
<TWO_WAY_BINDINGS>[(ngModel)]="…"
<OUTPUTS>(click)="…"
Reordering groups

Swap the position of entire groups — here outputs come first:

{
  "angularSortAttributesOrder": [
    "<OUTPUTS>",
    "<STRUCTURAL_DIRECTIVES>",
    "<ANIMATION_TRIGGERS>",
    "<ELEMENT_REFS>",
    "<HTML_ATTRIBUTES>",
    "<INPUTS>",
    "<TWO_WAY_BINDINGS>"
  ]
}
<!-- before -->
<button *ngIf="show" class="btn" [disabled]="loading" (click)="submit()" />

<!-- after -->
<button (click)="submit()" *ngIf="show" class="btn" [disabled]="loading" />
Promoting specific attributes to the top

List attribute names before the group tokens to pull them out of their group and pin them first:

{
  "angularSortAttributesOrder": [
    "id",
    "class",
    "<STRUCTURAL_DIRECTIVES>",
    "<HTML_ATTRIBUTES>",
    "<INPUTS>",
    "<TWO_WAY_BINDINGS>",
    "<OUTPUTS>"
  ]
}
<!-- before -->
<input
  *ngIf="show"
  aria-label="Name"
  class="field"
  [value]="name"
  id="name-input"
/>

<!-- after -->
<input
  id="name-input"
  class="field"
  *ngIf="show"
  aria-label="Name"
  [value]="name"
/>

id and class are pulled to positions 1 and 2. Other <HTML_ATTRIBUTES> (aria-label) stay in their group further down.

Partial order — specifying only some groups

You don't need to list every group. Any attribute not covered by your custom order falls back to its default group position, placed after all explicitly ordered entries:

{
  "angularSortAttributesOrder": ["<STRUCTURAL_DIRECTIVES>", "id", "class"]
}
<!-- before -->
<div
  (click)="fn()"
  class="card"
  *ngIf="show"
  [loading]="busy"
  id="main"
  foo="bar"
/>

<!-- after -->
<div
  *ngIf="show"
  id="main"
  class="card"
  foo="bar"
  [loading]="busy"
  (click)="fn()"
/>

*ngIf, id, and class are pinned first in the specified order. The remaining attributes — foo, [loading], (click) — follow in their default group order (string inputs → property bindings → outputs).

Requirements

  • Node.js 18+
  • Prettier 3+

License

ISC

Description from the npm listing.

  • prettier
  • prettier-plugin
  • angular
  • html
  • sort
  • attributes

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

@chazuk/prettier-plugin-angular-sort-attributes weekly downloads on npm, last 90 days: 108 weekly downloads as of Dec 5, 2026, +80.0% over 90 days.@chazuk/prettier-plugin-angular-sort-a…Weekly downloads on npm · Last 90 days108downloads / week+80.0% over 90 days050100150200250300Sep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@chazuk/prettier-plugin-angular-sort-attributes weekly downloads on npm, last 90 days: 108 weekly downloads as of Dec 5, 2026, +80.0% over 90 days.

7/30/90-day growth

@chazuk/prettier-plugin-angular-sort-attributes weekly downloads growth on npm: +42.1% over 7 days, +11.3% over 30 days, +80.0% over 90 days.@chazuk/prettier-plugin-angular-sort-a…Weekly downloads growth on npm108downloads / week now7-day growth+32 weekly downloads+42.1%30-day growth+11 weekly downloads+11.3%90-day growth+48 weekly downloads+80.0%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@chazuk/prettier-plugin-angular-sort-attributes weekly downloads growth on npm: +42.1% over 7 days, +11.3% over 30 days, +80.0% over 90 days.

Ranking history

@chazuk/prettier-plugin-angular-sort-attributes npm ranking history: currently #2611 (by weekly downloads).@chazuk/prettier-plugin-angular-sort-a…npm ranking · by weekly downloads · Last 90 days#2611current rank#1600#1800#2000#2200#2400#2600#2800Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
@chazuk/prettier-plugin-angular-sort-attributes npm ranking history: currently #2611 (by weekly downloads).

Listing placement

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

Listing placement

Prettier plugins267 listings · 14 pages · page 5, #9 (overall #89)
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 @chazuk/prettier-plugin-angular-sort-attributes
Date (UTC)Weekly downloadsChange vs. previous
1080
108-11
119+6
113-11
124+43
81+8
73-3
760
76+9
67-21
88-41
129-2
131-64
195—

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/@chazuk/prettier-plugin-angular-sort-attributes. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.