tilttek / accessible-dice
An accessible dice interface for Symfony on tilttek/dice-bundle: large targets, the faces of custom dice spoken and described by label, shape and value, results announced to screen readers in a polite live region, rolls of a dice tower on the same page announced too, reduced motion respected and not
Package info
github.com/TiltTek/accessible-dice
Type:symfony-bundle
pkg:composer/tilttek/accessible-dice
Requires
- php: >=8.5
- ext-filter: *
- symfony/config: ^8.2
- symfony/dependency-injection: ^8.2
- symfony/translation-contracts: ^3.6
- tilttek/dice: ^0.1@dev
- tilttek/dice-bundle: ^0.1@dev
Requires (Dev)
- php-webdriver/webdriver: ^1.16
- phpunit/phpunit: ^13.4
- symfony/event-dispatcher: ^8.2
- symfony/framework-bundle: ^8.2
- symfony/http-kernel: ^8.2
- symfony/panther: ^2.4
- symfony/stimulus-bundle: ^3.7
- symfony/translation: ^8.2
- symfony/twig-bridge: ^8.2
- symfony/twig-bundle: ^8.2
- symfony/yaml: ^8.2
- twig/twig: ^3.21
Suggests
- symfony/stimulus-bundle: For the controller that shows the expression and announces the results
- symfony/translation: To translate the words of the form and the announcements, and the labels of the faces
- symfony/twig-bundle: For accessible_dice() and the form
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-12 23:53:39 UTC
README
Dice anyone can roll: large targets, faces spoken and described, results announced to screen readers.
tilttek/accessible-dice is a Symfony bundle on tilttek/dice-bundle. It draws a dice form whose every die is a large
choice, whose custom dice have each face described by its label, its shape and its value — never by its colour alone
—, and whose result is announced in a polite live region, in a sentence that says every die. The form sends the choice
itself, and the server builds the expression from it, so that it rolls the same with or without its script. When a
dice tower of tilttek/dice-tower is on the same page, each of its rolls is announced too. Nothing moves for a viewer
who asked for reduced motion, and nothing is read aloud unless the viewer asks for it.
Status
| Part | State |
|---|---|
| The dice offered, standard and custom, and the expression of a choice, checked | Implemented and tested |
| The faces of the custom dice described by label, shape and value, in English and French | Implemented and tested |
| The sentence a roll is announced with | Implemented and tested |
accessible_dice() and its form: large targets, a polite live region, reduced motion, no sound by default |
Implemented and tested |
| The Stimulus controller: the expression shown, the rolls of a dice tower announced, reading aloud on request | Implemented and tested, in a browser |
Documentation
| Document | What it covers |
|---|---|
| Installation | Requirements, registering the bundle, the controller and its stylesheet. |
| Configuration | Every key, its default and what it sets. |
| The form | accessible_dice(), the choice sent, rolling it on the server, and announcing the result. |
| Accessibility | What the form does for screen readers, keyboards, motion and sound. |
| Extension points | Templates, styles, translations and listening to other dice. |
| Testing | The bundle's tests and its browser suite. |
| Reference | Every type and service of the bundle. |
Quick start
composer require tilttek/accessible-dice
// config/bundles.php return [ Tilttek\DiceBundle\TilttekDiceBundle::class => ['all' => true], Tilttek\AccessibleDice\TilttekAccessibleDiceBundle::class => ['all' => true], ];
{{ accessible_dice(path('roll'), result: result) }}
$expression = $accessibleDice->expression($request->request->all('dice')); $result = $diceRolls->roll($expression);
Requirements
PHP 8.5 or later, Symfony 8.2 and tilttek/dice-bundle; Twig, the translator and StimulusBundle for the form.
Contributing
Contributions are welcome on the PHIL monorepo: read the contribution guide and the code of conduct. Report a vulnerability privately, as the security policy explains, never in a public issue.
License
MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Tilttek project. See LICENSE.