PHPackages                             leonardohipolito/blade-class-props - 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. leonardohipolito/blade-class-props

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

leonardohipolito/blade-class-props
==================================

easy way to convert blade component properties to classes

134[1 PRs](https://github.com/leonardohipolito/blade-class-props/pulls)PHP

Since Aug 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/leonardohipolito/blade-class-props)[ Packagist](https://packagist.org/packages/leonardohipolito/blade-class-props)[ RSS](/packages/leonardohipolito-blade-class-props/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

easy way to convert blade component properties to classes
=========================================================

[](#easy-way-to-convert-blade-component-properties-to-classes)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b9cb1107f63242fe1e25657985f20116acdcc47a7147ad970bf1dd92b3bc0297/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c656f6e6172646f6869706f6c69746f2f626c6164652d636c6173732d70726f70732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/leonardohipolito/blade-class-props)[![GitHub Tests Action Status](https://camo.githubusercontent.com/39f633de391a973130692a112c12493882d02b1c1cee483a64037c79b09c28c6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6c656f6e6172646f6869706f6c69746f2f626c6164652d636c6173732d70726f70732f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/leonardohipolito/blade-class-props/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d3aac776a61bc734bfb84751e750e7f09940c03f0d87d544340e7da5bfcab27d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6c656f6e6172646f6869706f6c69746f2f626c6164652d636c6173732d70726f70732f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/leonardohipolito/blade-class-props/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/aed3eee66b5bc2cd025e87630f6a2c7de020165d78474a9b5e4b13f2293c7868/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c656f6e6172646f6869706f6c69746f2f626c6164652d636c6173732d70726f70732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/leonardohipolito/blade-class-props)

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

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

[](#installation)

You can install the package via composer:

```
composer require leonardohipolito/blade-class-props
```

Usage
-----

[](#usage)

```
// .../views/components/button.blade.php

classProps(['lg'=>'class-1 class-2','md'=>'class-3'], 'md')}}>
    {{$slot}}

//or

classProps(['lg'=>'class-1 class-2','md'=>'class-3'])}}>
    {{$slot}}

//or
classProps([
        'xs'=>fn($c)=>$c->has('outline')?'text-primary-500':'bg-primary-500 text-white',
        'md'=>'button-md'
    ],'md')
    ->classProps([
        'outline'=>'bg-transparent'
    ])
}}>
    {{$slot}}

```

now you can use your component:

```
Test
Test
```

outputs:

```

    Test

```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Leonardo Hipolito](https://github.com/leonardohipolito)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/06afd570b7de07ccf6c1658466c3c2367a362f98b5baff9c5179cee1182c2612?d=identicon)[leonardohipolito](/maintainers/leonardohipolito)

---

Top Contributors

[![leonardohipolito](https://avatars.githubusercontent.com/u/2807553?v=4)](https://github.com/leonardohipolito "leonardohipolito (14 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")

### Embed Badge

![Health badge](/badges/leonardohipolito-blade-class-props/health.svg)

```
[![Health](https://phpackages.com/badges/leonardohipolito-blade-class-props/health.svg)](https://phpackages.com/packages/leonardohipolito-blade-class-props)
```

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3841.2M](/packages/limenius-react-bundle)[pdewit/nova-external-url

An external URL Laravel Nova field.

30383.2k](/packages/pdewit-nova-external-url)[wbrowar/guide

A CMS Guide for Craft CMS.

6154.7k1](/packages/wbrowar-guide)

PHPackages © 2026

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