@forter/hotkey

1.4.3 • Public • Published

fc-hotkey

An element to simply add keyboard shortcuts to buttons and inputs :)

Usage

<script>
   import '@forter/hotkey';
</script>

<fc-hotkey keys="ctrl+z">
   <fc-button onclick="alert('here')"> Hotkey </fc-button>
</fc-hotkey>

Examples

<!-- focus -->
<fc-hotkey keys="ctrl+z">
   <fc-input></fc-input>
</fc-hotkey>

<!-- keypress -->
<fc-hotkey onkeypress="alert('keypress hotkey');" keys="ctrl+z">
    Hotkeys without slotted
</fc-hotkey>
parent

Properties

Property Attribute Type Description
description description string Text of the shortcut for the hotkeys modal
keys keys "ctrl+c" | "ctrl+shift+c" | "esc,space" key combination that will activate button click or input focus.
parent parent boolean Indicate if parent shoulbe be clicked instead slotted

Events

Event
keypress

CSS Custom Properties

Property Description
--fc-hotkey-text-color color.

Package Sidebar

Install

npm i @forter/hotkey

Weekly Downloads

1

Version

1.4.3

License

Apache-2.0

Unpacked Size

52.1 kB

Total Files

31

Last publish

Collaborators

  • forter-npm
  • lirown
  • oweingart