1.0.9 • Published 1 year ago
it2.0-keyboardshortcuts v1.0.9
Keyboard Shortcuts
This component allows you to create and manage keyboard shortcuts easily.
Installation
To install this package, run the following command:
npm i it2.0-keyboardshortcutsusage
Create the KeyboardShortcuts component as given below and call the component in your layout.js:
import KeyboardShortcuts from "it2.0-keyboardshortcuts";
function shortcuts() {
  const shortcuts = [
    { key: "1", url: "/page1" }, // Ctrl+1
    { key: "2", url: "/page2" }, // Ctrl+2
    { key: "3", url: "/page3" }, // Ctrl+3
    { key: "0", url: "/homePage" }, // Ctrl+0
  ];
  return (
    <div>
      <KeyboardShortcuts shortcuts={shortcuts} />
      {/* Rest of your app */}
    </div>
  );
}
export default shortcuts;