Ninja Keys

screenshot of Ninja Keys
react
svelte
vue

Keyboard shortcuts interface for your website. Working with static HTML, Vanilla JS, Vue, React, Svelte.

Overview

Ninja Keys is a keyboard shortcut interface for websites that works with Vanilla JS, Vue, and React. It allows users to quickly navigate and perform actions on websites using keyboard shortcuts. The library is lightweight and customizable, making it suitable for various types of websites.

Features

  • Keyboard navigation: Users can navigate through the website using keyboard shortcuts.
  • Light and dark theme: The library comes with built-in light and dark themes.
  • Built-in icon support: Ninja Keys supports icons from the Material font and custom SVG icons.
  • Nested menu: Users can organize shortcuts in a tree or flat data structure.
  • Root search: The search functionality allows users to easily find shortcuts within submenus.
  • CSS variable customization: Users can customize the appearance of Ninja Keys using CSS variables.
  • Customizable hotkeys: The hotkeys for opening, closing, and navigation can be customized to fit the website's needs.

Install from NPM

If you are using a build system like webpack, rollup, or vite, you can install Ninja Keys from NPM using the following command:

npm install ninja-keys

Install from CDN

If you are using HTML/JS without a build system, you can include Ninja Keys directly from a CDN like so:

<script src="https://cdn.jsdelivr.net/npm/ninja-keys@1.0.0/dist/ninja-keys.min.js"></script>

Usage

After installing Ninja Keys, you can add the <ninja-keys> tag to your HTML. You can use a flat data structure or a tree structure to define your shortcuts. The library provides various attributes that you can use to customize its behavior, such as placeholder, disableHotkeys, hideBreadcrumbs, openHotkey, navigationUpHotkey, navigationDownHotkey, and closeHotkey.

Summary

Ninja Keys is a versatile keyboard shortcut interface for websites, compatible with Vanilla JS, Vue, and React. It offers features like keyboard navigation, light and dark themes, icon support, nested menus, root search, customization options, and customizable hotkeys. With Ninja Keys, users can become keyboard ninjas and quickly navigate and perform actions on websites with ease.

react
React

React is a widely used JavaScript library for building user interfaces and single-page applications. It follows a component-based architecture and uses a virtual DOM to efficiently update and render UI components

svelte
Svelte

Svelte is a modern front-end framework that compiles your code at build time, resulting in smaller and faster applications. It uses a reactive approach to update the DOM, allowing for high performance and a smoother user experience.

vue
Vue

Vue.js is a lightweight and flexible JavaScript framework that allows developers to easily build dynamic and reactive user interfaces. Its intuitive syntax, modular architecture, and focus on performance make it a popular choice for modern web development.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

rollup
Rollup

RollupJS is a popular and efficient JavaScript module bundler that takes the code from multiple modules and packages them into a single optimized file, minimizing the overall size of the application and improving its performance.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.

web-components
Web Components

Web components provide a way to create reusable, encapsulated UI components using standard web technologies such as HTML, CSS, and JavaScript. They allow developers to create complex UI components that can be easily shared across multiple projects and frameworks. Web components are built using four main specifications: Custom Elements, Shadow DOM, HTML Templates, and ES Modules.