New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

a11y-aware

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a11y-aware

Micro-library & custom element that rewards accessible, semantic HTML and minimal, well-formed ARIA!

  • 0.3.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-91.67%
Maintainers
1
Weekly downloads
 
Created
Source

A11yAware

Pages Deploy NPM Version

I'm the micro-library and custom element that rewards accessible, semantic HTML and minimal, well-formed ARIA!

Given HTML containing a <button> and <dialog>:

<button
  id="triggerButton"
  aria-controls="myDialog"
  aria-expanded="false"> Click me! </button>

<dialog id="myDialog">
  <p> Hello, I’m a native dialog box! </p>
</dialog>

You can use this Javascript:

import A11yAware from 'A11yAware';

const buttonProxy = new A11yAware('#triggerButton');

buttonProxy.addToggleListener();

… To show and hide the dialog box, while correctly updating the state of the ARIA attributes, for example, aria-expanded.

Missing or incorrect ARIA is reported via helpful assertion errors in the browser console.

Aligning functionality with accessibility has to be a good thing 💡♿️

Neat, huh?

Custom element

The library exports the <a11y-aware> custom element – see the demo.

<a11y-aware>
  <button … ></button>
  <dialog … ></dialog>
</a11y-aware>

Guided mode

And, you can make accessibility issues more visible with a guided mode:

<a11y-aware guided="true">
  <button … ></button>
  <dialog … ></dialog>
</a11y-aware>

Support

The library currently tests for and/or supports(*) the following HTML elements and attributes:

Keywords

FAQs

Package last updated on 23 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc