vue-use-hotkeys

Vue composition for using keyboard shortcuts in components
1,867 7
Install
npm install vue-use-hotkeys
Latest Version:0.4.0
Vue:2 · 3
License:MIT
Last Updated:Oct 24, 2026
Links: GitHub  ·  npm
Maintainer: mitscherlich36

vue-use-hotkeys

Vue composition for using keyboard shortcuts in components. This is a hook version for hotkeys package.

Install

via pnpm, yarn or npm:

$ pnpm add vue-use-hotkeys
# or
$ yarn add vue-use-hotkeys
# or
$ npm i -S vue-use-hotkeys

Usage

import { defineComponent, ref } from 'vue'
import { useHotkeys } from 'vue-use-hotkeys'

export default defineComponent(() => {
  const count = ref(0)

  useHotKeys('ctrl + k', () => {
    count.value += 1
  })

  return () => (
    <p>
      Pressed <kbd>ctrl + k</kbd> {count.value} times.
    </p>
  )
})

Preview demo:

To-Do(s)

  • add support of @vue/composition-api;

License

MIT © Mitscherlich

Version History

Version Released Vue License
0.4.0 ^2.7.0 || >=3.0.0 MIT
0.3.5 ^2.0.0 || >=3.0.0 MIT
0.3.4 ^2.0.0 || >=3.0.0 MIT
0.3.3 ^2.0.0 || >=3.0.0 MIT
0.3.2 ^2.0.0 || >=3.0.0 MIT