Tiny Accessible Focus Trapping Library – tab-fixation

Category: Javascript | July 7, 2022
Author:TheOneAndOnlyZulu
Views Total:25 views
Official Page:Go to website
Last Update:July 7, 2022
License:MIT

Preview:

Tiny Accessible Focus Trapping Library – tab-fixation

Description:

tab-fixation is a lightweight, performant, accessible JavaScript library for trapping focus within a DOM element.

How to use it:

1. Install and import the tab-fixation library.

# Yarn
$ yarn add tab-fixation
# NPM
$ npm i tab-fixation
import {initFixation, removeFixation} from "tab-fixation";

2. Initialize the tab-fixation on the target element.

initFixation(myElement);

3. Remove focus trapping from a specific element.

removeFixation(myElement);

You Might Be Interested In:


Leave a Reply