PHPackages                             nielsdeblaauw/twigcs-a11y - 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. nielsdeblaauw/twigcs-a11y

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

nielsdeblaauw/twigcs-a11y
=========================

Accessibility rules for TwigCS

0.3.0(4y ago)984.4k↑33.3%3[1 issues](https://github.com/NielsdeBlaauw/twigcs-a11y/issues)MITPHP

Since Oct 8Pushed 4y ago1 watchersCompare

[ Source](https://github.com/NielsdeBlaauw/twigcs-a11y)[ Packagist](https://packagist.org/packages/nielsdeblaauw/twigcs-a11y)[ RSS](/packages/nielsdeblaauw-twigcs-a11y/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

twigcs-a11y
===========

[](#twigcs-a11y)

This is a [TwigCS](https://github.com/friendsoftwig/twigcs) accessibility ruleset. It statically checks twig templates for known accessibility issues.

The ruleset is inspired by [Deque's Axe Linter](https://axe-linter.deque.com/)

**Note:** *Automated tests do not guarantee your site is accessible. Manual testing is the only way to make sure.*

Want to learn more about creating accessible websites? Check out [The A11Y Collective](https://a11y-collective.com/).

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

[](#installation)

`composer require --dev nielsdeblaauw/twigcs-a11y`

Use
---

[](#use)

`vendor/bin/twigcs --ruleset \\NdB\\TwigCSA11Y\\Ruleset`

**Example Output**

```
./tests/test.twig
l.2 c.0 : ERROR [A11Y.TabIndex] Invalid 'tabindex'. Tabindex must be 0 or -1. Found `tabindex=1>.`
l.12 c.20 : ERROR [A11Y.TabIndex] Invalid 'tabindex'. Tabindex must be 0 or -1. Found `tabindex=test.`
l.12 c.53 : ERROR [A11Y.TabIndex] Invalid 'tabindex'. Tabindex must be 0 or -1. Found `tabindex='test'.`
l.16 c.0 : ERROR [A11Y.BannedHTMLTags] Tag 'marquee' is dissallowed. Found ``.
l.18 c.0 : ERROR [A11Y.BannedHTMLTags] Tag 'blink' is dissallowed. Found ``.
5 violation(s) found

```

For additional options read the [TwigCS documentation](https://github.com/friendsoftwig/twigcs).

Rules
-----

[](#rules)

The following rules are implemented as part of this ruleset.

### TabIndex

[](#tabindex)

**[Axe Tabindex rule description.](https://dequeuniversity.com/rules/axe/3.5/tabindex)**

Using a non `0` or `-1` value for tabindex results in unexpected behaviour for keyboard users. Variables in the tabindex property of an element are considered invalid.

### BannedHTMLTags

[](#bannedhtmltags)

**[Axe Blink rule description.](https://dequeuniversity.com/rules/axe/3.5/blink)**

**[Axe Marquee rule description.](https://dequeuniversity.com/rules/axe/3.5/marquee)**

The `blink` and `marquee` tags are disallowed from use. These elements can cause issues for users with cognitive disabilities.

### AriaRoles

[](#ariaroles)

**[Axe aria-roles rule description.](https://dequeuniversity.com/rules/axe/3.5/aria-roles)**

Catches invalid Aria role values. Typo's, non-standard and dynamic roles are not allowed.

Invalid roles can not be correctly interpreted by assistive technology.

Roadmap
-------

[](#roadmap)

The idea is to implement as many rules as possible from the [Axe Linter](https://axe-linter.deque.com/docs/ruleset/) ruleset.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 54.2% 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 ~165 days

Total

4

Last Release

1550d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/02fe3b568484997768925e14cabb4ee06b92592e86f8c0b8a56bf8912dde89f1?d=identicon)[NielsdeBlaauw](/maintainers/NielsdeBlaauw)

---

Top Contributors

[![NielsdeBlaauw](https://avatars.githubusercontent.com/u/661876?v=4)](https://github.com/NielsdeBlaauw "NielsdeBlaauw (13 commits)")[![MPParsley](https://avatars.githubusercontent.com/u/1823998?v=4)](https://github.com/MPParsley "MPParsley (11 commits)")

---

Tags

accessibilitycontinuous-integrationstatic-analysistwigtwigcs

###  Code Quality

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nielsdeblaauw-twigcs-a11y/health.svg)

```
[![Health](https://phpackages.com/badges/nielsdeblaauw-twigcs-a11y/health.svg)](https://phpackages.com/packages/nielsdeblaauw-twigcs-a11y)
```

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)[symfony/ux-icons

Renders local and remote SVG icons in your Twig templates.

555.8M69](/packages/symfony-ux-icons)

PHPackages © 2026

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