PHPackages                             artisanpack-ui/accessibility - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. artisanpack-ui/accessibility

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

artisanpack-ui/accessibility
============================

A package for all accessibility functions for ArtisanPack UI.

2.1.1(4mo ago)0893↑275%5GPL-3.0-or-laterPHPPHP ^8.2CI passing

Since Apr 16Pushed 1mo agoCompare

[ Source](https://github.com/ArtisanPack-UI/accessibility)[ Packagist](https://packagist.org/packages/artisanpack-ui/accessibility)[ RSS](/packages/artisanpack-ui-accessibility/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (12)Versions (17)Used By (5)

ArtisanPack UI Accessibility
============================

[](#artisanpack-ui-accessibility)

A PHP package for ensuring web applications meet accessibility standards, particularly for color contrast.

Features
--------

[](#features)

- **Color Contrast Checking**: Determine if text colors have sufficient contrast against background colors
- **Accessible Text Color Generation**: Generate accessible text colors based on background colors
- **Color Format Support**: Support for hex, Tailwind CSS, `rgb()`, and `hsl()` color formats.
- **User Accessibility Settings**: Manage user preferences for accessibility features
- **Laravel Integration**: Seamless integration with Laravel applications

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

[](#installation)

You can install the package via Composer:

```
composer require artisanpack-ui/accessibility
```

For detailed installation instructions, including Laravel integration, see the [Getting Started Guide](docs/getting-started.md).

Usage
-----

[](#usage)

Here is a practical, real-world example of how to use the package to create an accessible button component in Laravel.

### Creating an Accessible Button Component

[](#creating-an-accessible-button-component)

**1. Create a new Blade component:**

```
php artisan make:component Button
```

**2. Modify the component class:**

In `app/View/Components/Button.php`, we'll accept a background color and automatically determine the correct text color.

```
// app/View/Components/Button.php

namespace App\View\Components;

use Illuminate\View\Component;

class Button extends Component
{
    public string $bgColor;
    public string $textColor;

    public function __construct(string $bgColor = '#3b82f6')
    {
        $this->bgColor = $bgColor;
        $this->textColor = a11yGetContrastColor($this->bgColor);
    }

    public function render()
    {
        return view('components.button');
    }
}
```

**3. Update the component view:**

In `resources/views/components/button.blade.php`, we'll apply the colors as inline styles.

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

@props(['bgColor', 'textColor'])

merge(['class' => 'px-4 py-2 rounded']) }} style="background-color: {{ $bgColor }}; color: {{ $textColor }};">
    {{ $slot }}

```

**4. Use the component in your views:**

Now you can easily create accessible buttons with any background color.

```
Click Me

Delete

Success
```

For more detailed examples, including Livewire components and dynamic theming, see the [Real-World Examples](docs/examples.md) documentation.

Documentation
-------------

[](#documentation)

For complete documentation, please visit the links below.

- [**Real-World Examples**](docs/examples.md) - Practical examples of Blade and Livewire components.
- [**Best Practices**](docs/best-practices.md) - Learn how to use the package efficiently and performantly.
- [**Migration and Advanced Usage**](docs/migration.md) - Guide for migrating to a more advanced architecture.
- [**Troubleshooting**](docs/troubleshooting.md) - Solutions for common issues.
- [**API Reference**](docs/reference/api-reference.md) - Complete technical documentation.

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

[](#requirements)

- PHP 8.2 or higher
- Laravel 5.3 or higher (for Laravel integration)

Contributing
------------

[](#contributing)

As an open source project, this package is open to contributions from anyone. Please [read through the contributing guidelines](CONTRIBUTING.md) to learn more about how you can contribute to this project.

License
-------

[](#license)

This package is open-sourced software licensed under the [GPL-3.0-or-later license](LICENSE).

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance84

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

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

Recently: every ~60 days

Total

8

Last Release

129d ago

Major Versions

1.1.1 → 2.0.02025-11-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/ba2a2c40c9a93470595cd10701d2291434f3a7db61862d9700a9e69e31608c6c?d=identicon)[JacobMartellaWebDesign](/maintainers/JacobMartellaWebDesign)

---

Top Contributors

[![ViewFromTheBox](https://avatars.githubusercontent.com/u/8247489?v=4)](https://github.com/ViewFromTheBox "ViewFromTheBox (33 commits)")

---

Tags

a11yaccessibilityarialaravellaravel-packagephpwcag

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/artisanpack-ui-accessibility/health.svg)

```
[![Health](https://phpackages.com/badges/artisanpack-ui-accessibility/health.svg)](https://phpackages.com/packages/artisanpack-ui-accessibility)
```

PHPackages © 2026

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