Overview of TanStack Hotkeys
mainTanStack Hotkeys is a type-safe, framework-agnostic library designed for managing keyboard shortcuts. It handles the complexities of cross-platform compatibility, keyboard layouts, and conflicting scopes.
Key capabilities include:
- Hotkey Registration: Centralized management with conflict detection and automatic input filtering (e.g., ignoring hotkeys when an input is focused).
- Multi-Key Sequences: Support for Vim-style sequences (e.g.,
['G', 'G']) with configurable timeouts. - Hotkey Recording: Tools for capturing custom shortcuts in user settings interfaces.
- Key State Tracking: Hooks for monitoring held keys in real-time.
- Platform-Aware Formatting: Automatically formats hotkey strings for display (e.g.,
⌘⇧Son macOS vsCtrl+Shift+Son Windows). - Framework Support: Provides adapters for React, Preact, Solid, Angular, Vue, and Lit.