npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tabable/accessible-links

v1.0.3

Published

Resolves focus management issues for internal links to improve accessibility for all users, particularly individuals relying on assistive technologies like screen readers.

Downloads

27

Readme

Accessible Links from Tab-able

Looking for the node package @tabable/accessible-links?

Overview

This plugin resolves focus management issues for internal links to improve accessibility for all users, particularly individuals relying on assistive technologies like screen readers.

Features:

  • Automatic Focus Management: Seamlessly adds the tabindex attribute with a value of -1 to non-interactive elements targeted by internal links.
  • Enhanced Accessibility: Ensures users are moved directly to the intended section without disruptions or resets to the top of the page.
  • Assistive Technology Compatibility: Enhances user experiences for Windows Screen Magnifier, JAWS, and iOS VoiceOver.
  • Lightweight Integration: Works effortlessly with your site without requiring extensive configuration.
  • Customization Option: Applies a class to the focused element, enabling tailored styling.

How It Works

  1. For Links with DOM Anchors:

    • When a link pointing to a DOM anchor is activated:
      • The target content receives the attribute tabindex="-1".
      • The target content is also assigned the class accessible-links-focused.
  2. On Blur:

    • When focus leaves the target content:
      • The tabindex="-1" attribute is removed.
      • The accessible-links-focused class is also removed.
  3. For Links Navigating to Content on New Pages:

    • When a link leading to content on a new page is activated:
      • Upon loading the new page, a focus event is initialized for the targeted content.
      • Steps 1 and 2 are then applied, ensuring the intended focus management is performed.

Installation Guide for Non-npm Users

If you are not using npm and would like to embed the JavaScript file directly into your HTML, follow these steps:

1. Download the File

Download the minified JavaScript file (script.min.js) from the /dist folder.

2. Embed the Script

Add the following <script> tag to your HTML file to include the JavaScript file:

<script src="path-to/accessible-links.min.js"></script>

3. Automatic Functionality

Once the script is embedded, the following features are automatically activated:

  • Focus on Page Load: If the URL contains a hash (e.g., #section1), the corresponding element with the matching ID will gain focus when the page loads.
  • Focus on Browser Navigation: When navigating browser history using the back/forward buttons, the script ensures focus is reapplied to the appropriate element.

You don’t need to manually call any functions or add event listeners—they are already included in the script. Example usage:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Accessible Links Example</title>
</head>
<body>
    <a href="#section1">Go to Section 1</a>
    <div id="section1">Section 1 Content</div>

    <!-- Place your script at the end of the DOM -->
    <script src="script.min.js"></script>
</body>
</html>

Installation Guide for Node.js

  1. Install the package using:
    npm install accessible-links
  2. Import and use it in your Node.js project. Example usage:
    const { onPageLoad, onPopState } = require('accessible-links');
    
    // Set up event listeners to handle focus management
    window.addEventListener('load', onPageLoad); // Ensures focus is handled when the page loads with a hash fragment
    window.addEventListener('popstate', onPopState); // Reapplies focus when navigating browser history

Execute The Build

To optimize the JavaScript file for production, follow these steps:

  1. Install Dependencies:
    npm install
  2. Run the Build Script:
    npm run build