GitHub package.json version (subfolder of monorepo) npm bundle size npm bundle size ES Lint CodeQL

About Tab Fixation

Tab Fixation is a small focus trap library coded in Vanilla JS & bundled up with rollup.

Browser Support

Chrome Firefox Safari Opera Edge
Latest ✔ Latest ✔ Latest ✔ Latest ✔ Latest ✔

Installing

Using npm:

$ npm install tab-fixation

Using yarn:

$ yarn add tab-fixation

Using unpkg CDN:

<script src="https://unpkg.com/tab-fixation"></script>

Example

import {initFixation, removeFixation} from 'tab-fixation';

if ( document.getElementById( 'parent_element' ) ) {

	// Init tab fixation.
	initFixation( 'parent_element' );

	// Remove tab fixation.
	removeFixation( 'parent_element' );
}

Codepen Example

https://codepen.io/TheOneAndOnlyZulu/pen/OJvPPrZ

Objectives

This package aims to be:

  • Fully accessible: Complying to the latest WCAG guidelines, to AAA standard.
  • Lightweight: Website load times are key, not only to the ranking of your site, but the user experience. This package will always remain as small as possible, & never weigh you down.

Help me, I’m stuck!

Pop over to the discussions board.

I’ve got an idea?

Got ideas on how to improve this package, but not sure how to persue them? Head over to the discussion section of the repo, or if you’ve got the know how create a pull request.

GitHub

View Github