PHPackages                             hieu-le/body-classes - 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. hieu-le/body-classes

ActiveLibrary

hieu-le/body-classes
====================

Add classes to the body element dynamically.

1.0.0(10y ago)12.6k1MITPHP

Since Nov 16Pushed 10y agoCompare

[ Source](https://github.com/letrunghieu/body-classes)[ Packagist](https://packagist.org/packages/hieu-le/body-classes)[ RSS](/packages/hieu-le-body-classes/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (2)Used By (1)

Body classes
============

[](#body-classes)

Add classes to the body element dynamically.

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

[](#installation)

### Use Composer

[](#use-composer)

Add this package as your dependency:

```
$> composer require hieu-le/body-classes

```

### Do not use Composer

[](#do-not-use-composer)

Require the `src/Body.php` file into your code.

Usage
-----

[](#usage)

First, create a single object which holds all classes:

```

```

When you want to add new classes:

```

```

If the new added classes were added before, they will be ignored.

Finnaly, when you want to print these classes:

```

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Unknown

Total

1

Last Release

3833d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/98ce9136dff54b74ddb9afe69ae5c9c0cf573b00603e80ad9ee332f24f0b1342?d=identicon)[letrunghieu](/maintainers/letrunghieu)

---

Top Contributors

[![letrunghieu](https://avatars.githubusercontent.com/u/1145335?v=4)](https://github.com/letrunghieu "letrunghieu (9 commits)")

---

Tags

classesdynamicbody

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hieu-le-body-classes/health.svg)

```
[![Health](https://phpackages.com/badges/hieu-le-body-classes/health.svg)](https://phpackages.com/packages/hieu-le-body-classes)
```

###  Alternatives

[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[lorisleiva/lody

Load files and classes as lazy collections in Laravel.

956.6M9](/packages/lorisleiva-lody)[gehrisandro/tailwind-merge-php

TailwindMerge for PHP merges multiple Tailwind CSS classes by automatically resolving conflicts between them

1391.5M9](/packages/gehrisandro-tailwind-merge-php)[kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

743.1M27](/packages/kartik-v-yii2-dynagrid)[nunomaduro/mock-final-classes

Allows mocking of final methods and classes in PHP.

113854.3k23](/packages/nunomaduro-mock-final-classes)[digital-creative/conditional-container

Provides an easy way to conditionally show and hide fields in your Nova resources.

116593.8k4](/packages/digital-creative-conditional-container)

PHPackages © 2026

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