PHPackages                             statix/tailor - 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. statix/tailor

ActiveLibrary

statix/tailor
=============

0.0.6(1y ago)018MITPHP

Since Nov 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/statix-php/tailor)[ Packagist](https://packagist.org/packages/statix/tailor)[ RSS](/packages/statix-tailor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (6)Versions (8)Used By (0)

[![Statix](./.art/banner.png)](./.art/banner.png)

*Tailor* for Laravel Blade
==========================

[](#tailor-for-laravel-blade)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f4a6fec5cae0e62035fb93670e3c5bf4a6f484ac40d3a25cb47994b03fa89117/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7374617469782f7461696c6f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/statix/tailor)[![Packagist Downloads](https://camo.githubusercontent.com/49453104dd8d317731549d5bc6dfc682bc760a24b9dfc2cb5175afff68385d97/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7374617469782f7461696c6f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/statix/tailor)

A *neat* package to help build Blade component libraries.

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

[](#installation)

```
composer require statix/tailor
```

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

[](#configuration)

Publishing the configuration file is optional.

```
php artisan vendor:publish --tag=tailor-config
```

Usage
-----

[](#usage)

### Building a Component

[](#building-a-component)

```
// view/components/button.blade.php

@props([
    'variant' => 'primary',
    'size' => 'md'
    'type' => 'button',
    'tag' => 'button',
])

@php
// create the tailor
$c = Tailor::make('button');

// start setting up the attributes
$c->attributes()
    ->set([
        'data-variant' => $variant,
        'data-size' => $size,
    ])->if($tag !== 'button', function ($set) use ($type) {
        $set('type', $type);
        $set('aria-role', 'button');
    })->if($tag === 'a', function ($set) {
        $set('aria-role', 'link');
    });

// start building the variants
$c->variant('primary');
$c->variant('secondary');

// start building the classes common to all variants
$c->classes()
    ->base([
        'rounded-md',
        'border',
    ])->focus([
        'focus:ring-2',
        'focus-visible:outline-offset-2',
    ])->match($size, [
        'sm' => 'px-2 py-1',
        'md' => 'px-3 py-2',
        'lg' => 'px-4 py-3',
        'xl' => 'px-5 py-4',
        'default' => $size,
    ]);

// start building the classes for the primary variant
$p = $c->variant('primary');

$p->classes()
    ->light([
        'bg-indigo-600',
    ])->hoverLight([
        'hover:bg-indigo-500',
    ])->focusLight([
        'focus-visible:outline-indigo-600',
    ])->dark([
        'dark:text-white',
        'dark:bg-indigo-700',
    ]);

// start building the classes for the secondary variant
$s = $c->variant('secondary');

$s->classes()
    ->light([
        'bg-gray-200',
    ])->hoverLight([
        'hover:bg-gray-300',
    ])->focusLight([
        'focus-visible:outline-gray-200',
    ])->dark([
        'dark:text-gray-200',
        'dark:bg-gray-700',
    ])->focusDark([
        'focus-visible:outline-gray-200',
    ]);

// merge the attributes and classes with the passed attributes
$c->attributes()->merge($attributes->getAttributes());
$c->classes()->merge($attributes->get('class', ''));

// set the variant to use
$c->setVariant($variant);

// now when we output the component, the classes
// and attributes will be applied, specific to the variant

$c->attributes()
    ->set('onclick', 'alert("Hello")')
    ->set('onDblClick', '$wire.emit("dblClick")');
@endphp

{{ $slot}}
```

### Using the Component

[](#using-the-component)

```

    Click Me

    A link button

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance41

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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 ~9 days

Total

6

Last Release

491d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ec1f5d67a8ace8451f50303ed7fc9185a8298b9a38dc4d47c3aeb283255e66d?d=identicon)[wyattcast44](/maintainers/wyattcast44)

---

Top Contributors

[![WyattCast44](https://avatars.githubusercontent.com/u/17957937?v=4)](https://github.com/WyattCast44 "WyattCast44 (19 commits)")

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/statix-tailor/health.svg)

```
[![Health](https://phpackages.com/badges/statix-tailor/health.svg)](https://phpackages.com/packages/statix-tailor)
```

###  Alternatives

[spatie/laravel-activitylog

A very simple activity logger to monitor the users of your website or application

5.8k45.4M309](/packages/spatie-laravel-activitylog)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[awcodes/filament-curator

A media picker plugin for FilamentPHP.

434297.7k19](/packages/awcodes-filament-curator)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[wnx/laravel-sends

Keep track of outgoing emails in your Laravel application.

200427.3k](/packages/wnx-laravel-sends)[saasykit/laravel-open-graphy

An awesome open graph image (social cards) generator package for Laravel.

13057.0k](/packages/saasykit-laravel-open-graphy)

PHPackages © 2026

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