项目作者: chialab

项目描述 :
An accessibility helper for keyboard navigation on the web.
高级语言: JavaScript
项目地址: git://github.com/chialab/loock.git
创建时间: 2018-10-26T15:50:03Z
项目社区:https://github.com/chialab/loock

开源协议:MIT License

下载


Loock

Refined keyboard navigation for websites and components.

NPM

Introducing Loock

  • Organize your web page or web application by navigation areas.
  • Never lose the context while navigating the area with the TAB key.
  • Leave the context with the ESC key.

Install

NPM

  1. npm install @chialab/loock
  1. yarn add @chialab/loock

CDN

  1. import { focusTrapBehavior } from 'https://unpkg.com/@chialab/loock?module';

Usage

  1. import { focusTrapBehavior } from '@chialab/loock';
  2. const dialog = document.getElementById('.dialog');
  3. const trap = focusTrapBehavior(dialog, {
  4. inert: true,
  5. });
  6. dialog.addEventListener('open', () => {
  7. trap.connect();
  8. });

Development

Build status

Build

Install the dependencies and run the build script:

  1. yarn install
  1. yarn build

This will generate the bundles in the dist folder, as well as the declaration file.

Test

Run the test script:

  1. yarn test

License

Loock is released under the MIT license.