PHPackages                             joelstein/blade-formatter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. joelstein/blade-formatter

ActiveProject[Templating &amp; Views](/categories/templating)

joelstein/blade-formatter
=========================

Format Blade templates and Livewire SFCs with Pint, Tailwind class sorting, and auto-indentation

v0.8.1(1mo ago)5349—10%MITPHPPHP ^8.2

Since Mar 22Pushed 1w agoCompare

[ Source](https://github.com/joelstein/blade-formatter)[ Packagist](https://packagist.org/packages/joelstein/blade-formatter)[ RSS](/packages/joelstein-blade-formatter/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (13)Versions (41)Used By (0)

Blade Formatter
===============

[](#blade-formatter)

A tool that formats Blade templates and Livewire Single File Components. Like [Laravel Pint](https://laravel.com/docs/pint) for Blade — run a single command and your files are clean. Includes a VS Code extension with format-on-save and automatic PHP/Blade language switching.

What It Does
------------

[](#what-it-does)

Blade Formatter runs three formatters in sequence:

1. **PHP formatting** — Formats PHP in Livewire SFC sections and `@php`/`@endphp` blocks using Laravel Pint
2. **Blade indentation** — Auto-indents Blade templates with proper nesting for directives, HTML, components, and Alpine.js attributes
3. **Tailwind class sorting** — Sorts Tailwind CSS classes using Prettier with [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss)

Each formatter can be enabled or disabled independently. Markdown mail templates (``) are automatically skipped to preserve whitespace-sensitive formatting.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Node.js (for Tailwind class sorting)

Installation
------------

[](#installation)

```
composer require joelstein/blade-formatter --dev
npm install -D prettier prettier-plugin-tailwindcss

# VS Code extension (optional)
code --install-extension vendor/joelstein/blade-formatter/builds/blade-formatter.vsix
```

The VS Code extension requires the [Laravel](https://marketplace.visualstudio.com/items?itemName=laravel.vscode-laravel) extension.

Usage
-----

[](#usage)

```
# Format all Blade files
vendor/bin/blade-format

# Format specific files or directories
vendor/bin/blade-format resources/views/components

# Check formatting without making changes (for CI)
vendor/bin/blade-format --test

# Stop on first file that would change (for CI)
vendor/bin/blade-format --bail

# Only format files changed since a branch
vendor/bin/blade-format --diff=main
```

Configuration
-------------

[](#configuration)

Create a `blade-formatter.json` in your project root:

```
{
    "paths": ["resources/views"],
    "exclude": [],
    "indent_size": 4,
    "pint_config_path": null,
    "enable_pint": true,
    "enable_tailwind_sort": true,
    "enable_indentation": true,
    "prettier_path": "node_modules/.bin/prettier"
}
```

VS Code Extension
-----------------

[](#vs-code-extension)

The extension provides format-on-save and automatic PHP/Blade language switching in Livewire SFCs. All settings are under `bladeFormatter.*`:

SettingDefaultDescription`enable``true`Enable or disable the extension`formatOnSave``true`Format Blade files on save`enableLanguageSwitching``true`Switch PHP/Blade language modes in SFCs`executablePath``""`Custom path to `blade-format` binaryFormatting options (indent size, enable/disable formatters, etc.) are configured in `blade-formatter.json` — not in VS Code settings. This keeps CLI and editor output consistent.

> **Note:** If you use the [Laravel Pint](https://marketplace.visualstudio.com/items?itemName=laravel.vscode-laravel) VS Code extension with `Laravel.pint.runOnSave` enabled, Pint will strip `use` statements from SFCs that are only referenced in Blade — undoing the blade formatter's work. Disable Pint's run-on-save for Blade files in your `.vscode/settings.json`:
>
> ```
> {
>   "[blade]": {
>     "Laravel.pint.runOnSave": false
>   }
> }
> ```

CI Integration
--------------

[](#ci-integration)

```
- name: Check formatting
  run: |
    vendor/bin/pint --test
    vendor/bin/blade-format --test
```

License
-------

[](#license)

MIT

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance96

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Recently: every ~8 days

Total

40

Last Release

33d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0059aaf8eed7ca19ce7ed1aa4434990350f92e09b86c9fdf57e98f536ef4c765?d=identicon)[joelstein](/maintainers/joelstein)

---

Top Contributors

[![joelstein](https://avatars.githubusercontent.com/u/152397?v=4)](https://github.com/joelstein "joelstein (50 commits)")

---

Tags

formatterlaravelbladelivewiretailwindPint

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/joelstein-blade-formatter/health.svg)

```
[![Health](https://phpackages.com/badges/joelstein-blade-formatter/health.svg)](https://phpackages.com/packages/joelstein-blade-formatter)
```

###  Alternatives

[robsontenorio/mary

Gorgeous UI components for Livewire powered by daisyUI and Tailwind

1.5k531.0k21](/packages/robsontenorio-mary)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.3k449.3k30](/packages/tightenco-jigsaw)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9742.3M121](/packages/roots-acorn)[laravel/ai

The official AI SDK for Laravel.

9782.1M161](/packages/laravel-ai)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

721160.4k12](/packages/tallstackui-tallstackui)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4821.5k](/packages/erag-laravel-lang-sync-inertia)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
