@jswork/next-hotkey-focus

1.0.4 • Public • Published

next-hotkey-focus

Manage elements focus by hotkey.

version license size download

installation

npm install -S @jswork/next-hotkey-focus

usage

import '@jswork/next-hotkey-focus';

// Make sure selector elements are loaded.
window.addEventListener("DOMContentLoaded", () => {
  nx.hotkeyFocus({
    keys: ['cmd + k'], 
    selectors: ['input[data-hotkey-focus]'],
    callback: (e) => {
      console.log('focued!');
    }
  })
})

license

Code released under the MIT license.

/@jswork/next-hotkey-focus/

    Package Sidebar

    Install

    npm i @jswork/next-hotkey-focus

    Weekly Downloads

    1

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    5.71 kB

    Total Files

    5

    Last publish

    Collaborators

    • afeiship