Zum Inhalt springen
Skillpedia
Websites & UI (Frontend)75k · #2806

custom-element-accessibility

Was er macht

Dieser Skill prüft Oberflächenteile, die von Grund auf selbst gebaut wurden, etwa besondere Buttons oder Eingaben. Er ist für Entwickler gedacht, die eigene Web-Komponenten bauen.

Wann du ihn nutzt

  • ✓Wenn du einen eigenen Button, ein Menü oder eine Eingabe von Grund auf gebaut hast.
  • ✓Wenn Screenreader-Nutzer nicht erkennen, was ein eigenes Bedienelement tut.
  • ✓Wenn sich eine eigene Eingabe nicht in einem normalen Webformular verhält.

Link zum Skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/custom-element-accessibility/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/custom-element-accessibility/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Kannst du prüfen, ob mein eigenes Widget mit Tastatur und Screenreader funktioniert?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Agent prüft den Widget-Code auf fehlende ARIA-Beschriftungen, Tastaturbedienung und Formularverknüpfung. Danach schlägt er Ergänzungen vor, die das Widget wie ein natives Bedienelement wirken lassen.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Make custom elements and Web Components accessible

Custom elements that lack ARIA reflection are invisible to screen readers — a button that looks correct visually may be announced as a generic "group" or not at all. ElementInternals provides the bridge between the shadow DOM and the accessibility tree, and it is also the only standards-compliant way to integrate custom inputs with native HTML forms.

Quick Reference

  • Prefer native <button>, <input>, <select>, and <details> before building a custom widget
  • Use ElementInternals.ariaRole to expose ARIA semantics from the shadow DOM
  • Implement form-associated custom elements with ElementInternals for native form participation
  • Apply roving tabindex for compound widgets (listbox, toolbar, menu)
  • The shadow DOM does not automatically expose ARIA to the accessibility tree without ElementInternals

Check

Inspect these custom element definitions for missing ElementInternals setup, absent ARIA reflection, incomplete keyboard interaction patterns, and lack of form association for input-like components. First verify that the widget truly needs to be custom rather than a native control with styling.

Fix

Add ElementInternals attachment in the constructor, implement ariaRole and ariaLabel reflection, add keyboard event handlers following ARIA authoring patterns, and use formAssociated for custom input elements. Replace the component with native HTML when the native control already supports the required interaction.

Explain

Explain why the shadow DOM does not automatically expose ARIA semantics and how ElementInternals bridges the gap between custom elements and the accessibility tree.

Code Review

Review custom element class files for ElementInternals attachment, ARIA property reflection, keyboard interaction (Tab, Enter, Space, Arrow keys), focus management, and formAssociated static property on input-like elements. Flag cases where a native control would remove the accessibility burden entirely.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/html/custom-element-accessibility

Häufige Fragen

Sollte ich überhaupt eigene Bedienelemente bauen?

Der Skill prüft zuerst, ob ein Standard-HTML-Element mit Gestaltung die Aufgabe erfüllen kann. Eigene Bedienelemente sind der letzte Ausweg.

Was ist ElementInternals?

Es ist eine Browserfunktion, mit der eigene Komponenten ihre Bedeutung und Formulardaten an die Seite weitergeben. Der Skill empfiehlt sie.

Welche Teile eines Widgets prüft er?

Er prüft ARIA-Rollen und -Beschriftungen, die Tastaturbedienung und die Formularzuordnung bei eingabeähnlichen Teilen.

Details

Originalbeschreibung des Autors

Use when reviewing custom element class definitions or Web Component source code to check for missing ARIA reflection, keyboard handling, and form association.

repo: thedaviddias/Front-End-Checklist

Beliebtheit

GitHub-Sterne
75k
Platz im Ranking
#2806
Lizenz
MIT
Aktualisiert
31.10.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills