Skip to content

accessKeys

Disallow the use of the accessKey / accesskey attribute on JSX elements.

✅ This rule is included in the jsx logical preset.

The accesskey attribute historically provides keyboard shortcuts but is unreliable across browsers and can conflict with assistive technologies or built-in browser shortcuts. Prefer application-level, well-documented keyboard shortcuts and visible UI affordances instead of embedding accesskey in markup.

<button accessKey="h">Help</button>

This rule is not configurable.

If you’re working on an internal legacy codebase that is targeted towards specific users, it might be difficult to switch from access key props towards a more comprehensive modern solution. However, whenever possible for production code and libraries, prefer more predictable and discoverable keyboard handling.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.