Saltar al contenido
Skillpedia
Sitios e interfaces (frontend)75 mil · #2806

custom-element-accessibility

Qué hace

Esta skill comprueba las partes de interfaz personalizadas creadas desde cero, como botones o campos especiales. Es para desarrolladores que crean sus propios componentes web.

Cuándo usarla

  • ✓Cuando has creado desde cero un botón, un menú o un campo personalizado.
  • ✓Cuando los usuarios de lector de pantalla no pueden saber qué hace un control personalizado.
  • ✓Cuando un campo personalizado no funciona dentro de un formulario web normal.

Link de la skill

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

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/custom-element-accessibility/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“¿Puedes comprobar si mi widget personalizado funciona con teclado y con lector de pantalla?”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

Tu agente revisa el código del widget en busca de etiquetas ARIA que faltan, de gestión del teclado y de vínculos con formularios. Después sugiere añadidos para que el widget se comporte como un control nativo.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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

Preguntas frecuentes

¿Debo crear controles personalizados?

La skill sugiere primero comprobar si un control HTML estándar con estilos puede hacer el trabajo. Los controles personalizados son el último recurso.

¿Qué es ElementInternals?

Es una función del navegador que permite a los componentes personalizados compartir su significado y sus datos de formulario con la página. La skill recomienda usarla.

¿Qué partes de un widget comprueba?

Revisa los roles y etiquetas ARIA, la interacción con el teclado y la asociación con formularios en las partes tipo campo.

Detalles

Descripción original del autor

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

Popularidad

Estrellas en GitHub
75 mil
Posición en el ranking
#2806
Licencia
MIT
Actualizada
31/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas