
Pixijs Accessibility
- 2.8k installs
- 293 repo stars
- Updated June 4, 2026
- pixijs/pixijs-skills
pixijs-accessibility adds screen reader and keyboard navigation to PixiJS v8 via AccessibilitySystem and container accessible properties.
About
The pixijs-accessibility skill enables screen reader and keyboard navigation in PixiJS v8 through AccessibilitySystem and per-container accessible properties. Set accessible, accessibleTitle, accessibleHint, accessibleText, accessibleType, tabIndex, and accessibleChildren on Sprites and Containers, with eventMode static or dynamic required for custom tab order. Initialize with accessibilityOptions including enabledByDefault, debug, activateOnTab, and deactivateOnMouseMove, or call setAccessibilityEnabled at runtime. By default the overlay activates only after Tab unless enabledByDefault is true; mobile uses a hidden touch hook for session-wide activation. Screen readers trigger pointertap, click, and tap FederatedEvents through shadow DOM elements when users press Enter, Space, or screen reader actions. Focus on shadow divs dispatches mouseover and mouseout on the mapped container. Common mistakes include missing accessibleTitle, expecting overlay without Tab, deactivateOnMouseMove breaking mouse testing, and forgetting pixi.js/accessibility import in custom builds with skipExtensionImports. Related skills cover pixijs-events, pixijs-scene-dom-container, and pixijs-application ini.
- AccessibilitySystem creates shadow DOM overlays over accessible containers for assistive tech.
- Per-container accessibleTitle, accessibleHint, tabIndex, and eventMode static for tab order.
- enabledByDefault, activateOnTab, deactivateOnMouseMove via accessibilityOptions at init.
- Screen reader activation dispatches pointertap, click, and tap FederatedEvents.
- Requires pixi.js/accessibility import when skipExtensionImports is true in custom builds.
Pixijs Accessibility by the numbers
- 2,806 all-time installs (skills.sh)
- +205 installs in the week ending Jul 28, 2026 (Skillselion tracking)
- Ranked #184 of 2,277 Frontend Development skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
pixijs-accessibility capabilities & compatibility
- Capabilities
- per container accessible overlay configuration · custom tab order with eventmode and tabindex · runtime and init accessibilityoptions control · mobile touch hook activation for screen readers · federatedevents dispatch from shadow dom activat
- Use cases
- frontend · ui design · testing
What pixijs-accessibility says it does
Enable screen reader and keyboard navigation via PixiJS's AccessibilitySystem.
npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-accessibilityAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 2.8k |
|---|---|
| repo stars | ★ 293 |
| Security audit | 3 / 3 scanners passed |
| Last updated | June 4, 2026 |
| Repository | pixijs/pixijs-skills ↗ |
How do I make PixiJS canvas sprites and containers reachable by screen readers and keyboard Tab order?
Add screen reader and keyboard navigation to PixiJS v8 apps via AccessibilitySystem, per-container properties, and shadow DOM overlays.
Who is it for?
PixiJS v8 games and canvas apps needing a11y, ARIA labels, tab navigation, or screen reader support.
Skip if: Skip for plain HTML apps without PixiJS or when DOM-based UI already covers accessibility needs.
When should I use this skill?
User mentions PixiJS accessibility, a11y, screen reader, ARIA, tab order, or AccessibilitySystem.
What you get
Accessible overlay with titled elements, custom tab order, and pointer or keyboard activation through FederatedEvents.
- AccessibilitySystem configuration
- Labeled accessible containers
- Keyboard-navigable canvas UI
By the numbers
- Targets PixiJS v8 AccessibilitySystem APIs
- Documents 4 core system options: enabledByDefault, debug, activateOnTab, deactivateOnMouseMove
Files
Enable screen reader and keyboard navigation via PixiJS's AccessibilitySystem. The system creates an invisible shadow DOM overlay positioned over accessible containers so assistive technology can discover and activate them.
Quick Start
const button = new Sprite(await Assets.load("button.png"));
button.accessible = true;
button.accessibleTitle = "Play game";
button.accessibleHint = "Starts a new game session";
button.eventMode = "static";
button.tabIndex = 0;
app.stage.addChild(button);
app.renderer.accessibility.setAccessibilityEnabled(true);
button.on("pointertap", () => startGame());Related skills: pixijs-events (pointer/tap handlers), pixijs-scene-dom-container (HTML elements on canvas), pixijs-application (init options).
Key points:
- By default the system activates only after the user presses Tab. Set
enabledByDefault: truein Application init for immediate activation. - On mobile, the system creates a hidden touch hook; screen-reader focus activates accessibility for the whole session.
- The AccessibilitySystem requires the main thread; it is not available in a Web Worker.
Core Patterns
Container accessible properties
import { Container, Sprite } from "pixi.js";
const container = new Container();
container.accessible = true;
container.accessibleTitle = "Navigation menu";
container.accessibleHint = "Contains links to other pages";
container.eventMode = "static"; // required for custom tabIndex to apply
container.tabIndex = 0;
container.accessibleType = "div"; // defaults to 'button'
const sprite = new Sprite();
sprite.accessible = true;
sprite.accessibleTitle = "Close dialog";
sprite.accessibleText = "X"; // text content of the shadow div
sprite.eventMode = "static";
sprite.tabIndex = 1;Available properties on any Container:
accessible(boolean) - enables the accessible overlay divaccessibleTitle(string) - sets thetitleattribute on the shadow divaccessibleHint(string) - sets thearia-labelattributeaccessibleText(string) - sets inner text content of the shadow divaccessibleType(string) - HTML tag for the shadow element, defaults to'button'tabIndex(number) - tab order for keyboard navigation (only applied wheninteractiveis true /eventModeis'static'or'dynamic')accessibleChildren(boolean, defaulttrue) - whenfalse, prevents child containers from being accessibleaccessiblePointerEvents(string) - CSSpointer-eventsvalue on the shadow div
Custom tab order
Give each accessible container a tabIndex to control the order assistive tech walks through them. Higher numbers come later; equal numbers fall back to scene-graph order.
menuButton.accessible = true;
menuButton.eventMode = "static";
menuButton.tabIndex = 1;
playButton.accessible = true;
playButton.eventMode = "static";
playButton.tabIndex = 2;
settingsButton.accessible = true;
settingsButton.eventMode = "static";
settingsButton.tabIndex = 3;tabIndex is only forwarded to the shadow div when the container is interactive (eventMode is 'static' or 'dynamic'). Without that, the system clamps the div's tabIndex back to 0, and the order you set is ignored.
Programmatic control
import { Application } from "pixi.js";
const app = new Application();
await app.init({ width: 800, height: 600 });
// Enable accessibility at runtime
app.renderer.accessibility.setAccessibilityEnabled(true);
// Check current state
console.log(app.renderer.accessibility.isActive);
console.log(app.renderer.accessibility.isMobileAccessibility);
// Full init options:
await app.init({
accessibilityOptions: {
enabledByDefault: true, // activate immediately (default: false)
debug: true, // makes overlay divs visible (default: false)
activateOnTab: true, // Tab key activates system (default: true)
deactivateOnMouseMove: false, // stay active when mouse moves (default: true)
},
});The system can also be configured via static defaults before creating the Application:
import { AccessibilitySystem, Application } from "pixi.js";
AccessibilitySystem.defaultOptions.enabledByDefault = true;
AccessibilitySystem.defaultOptions.deactivateOnMouseMove = false;
const app = new Application();
await app.init();Handling accessible interactions
import { Sprite } from "pixi.js";
const button = new Sprite();
button.eventMode = "static";
button.accessible = true;
button.accessibleTitle = "Submit form";
button.tabIndex = 0;
// Screen readers trigger click/tap events through the shadow DOM element
button.on("pointertap", () => {
submitForm();
});When accessibility is active and a user activates a shadow div (via Enter/Space key or screen reader action), the system dispatches click, pointertap, and tap FederatedEvents to the corresponding container. Focus on the shadow div dispatches mouseover, and focus-out dispatches mouseout. Both eventMode and accessible should be set for full keyboard + pointer support.
Common Mistakes
[MEDIUM] Expecting accessibility to be active without Tab key press
The AccessibilitySystem does not create its DOM overlay until the user presses Tab (or, on mobile, focuses the touch hook). If your application needs accessibility immediately:
const app = new Application();
await app.init({
accessibilityOptions: {
enabledByDefault: true,
},
});Or at runtime:
app.renderer.accessibility.setAccessibilityEnabled(true);Without one of these, automated accessibility testing tools will not find the overlay elements.
[MEDIUM] Setting accessible without accessibleTitle
Wrong:
const sprite = new Sprite();
sprite.accessible = true;
// no title or hint setCorrect:
const sprite = new Sprite();
sprite.accessible = true;
sprite.accessibleTitle = "Play button";
sprite.accessibleHint = "Click to start the game";A container with accessible = true but no accessibleTitle or accessibleHint gets a fallback title of "container {tabIndex}". Screen readers will announce this generic label with no useful context. Always provide at least accessibleTitle.
[MEDIUM] Accessibility deactivates when moving mouse
By default, deactivateOnMouseMove is true. Any mouse movement after Tab-activation will deactivate the overlay. This is by design (assumes keyboard-only users don't use a mouse), but it makes testing with a mouse frustrating.
await app.init({
accessibilityOptions: {
deactivateOnMouseMove: false,
},
});[MEDIUM] Not importing accessibility extension in custom builds
When using skipExtensionImports: true for a custom build, the accessibility extension is not automatically registered. You must import it explicitly:
import "pixi.js/accessibility";
import { Application } from "pixi.js";
const app = new Application();
await app.init({ skipExtensionImports: true });Without this import, app.renderer.accessibility will be undefined and no shadow DOM layer will be created.
API Reference
Related skills
How it compares
Choose pixijs-accessibility over generic web a11y skills when the UI renders inside PixiJS v8 canvas containers rather than standard DOM components.
FAQ
Why does automated testing find no overlay elements?
The system activates after Tab by default; set enabledByDefault true or call setAccessibilityEnabled at runtime.
Why is my tabIndex order ignored?
tabIndex applies only when eventMode is static or dynamic; without interactive mode the system clamps to zero.
What label do screen readers announce without accessibleTitle?
A generic fallback like container plus tabIndex with no useful context; always set accessibleTitle or accessibleHint.
Is Pixijs Accessibility safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.