A deprecated React HOC library for implementing spatial navigation (directional key navigation) in TV and remote-controlled applications.
react-spatial-navigation is a React library that provides spatial navigation (directional key navigation) for TV, gaming, and remote-controlled applications. It uses a higher-order component (HOC) to automatically manage focus movement between UI components based on arrow key inputs, eliminating the need for manual navigation logic.
Developers building React applications for TV platforms (e.g., Smart TVs, set-top boxes) or any interface requiring remote-controlled navigation, such as gaming consoles or kiosks.
It simplifies spatial navigation implementation by automatically calculating focus targets, supports both web and React Native TV environments, and offers extensive customization for key mapping and focus behavior.
DEPRECATED. HOC-based Spatial Navigation. NEW Hooks version is available here: https://github.com/NoriginMedia/norigin-spatial-navigation
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Determines the next focusable component based on directional key input without explicit logic, reducing manual navigation code as described in the key features.
Includes a native mode for React Native TV apps, syncing focus state with native navigation systems for seamless integration in TV environments.
Supports custom key codes via setKeyMap for compatibility with various remote controls, as shown in the initialization example.
Provides props like onBecameFocused and onArrowPress with detailed payloads, allowing fine-grained control over focus events and interactions.
Explicitly marked as deprecated with a new Hooks-based version available, meaning no future updates, bug fixes, or support for this HOC version.
Relies on higher-order components which can lead to wrapper complexity and is less aligned with modern React Hooks patterns, potentially making code harder to maintain.
Lacks unit tests and mouse support as acknowledged in the TODOs, affecting reliability and limiting usability for non-keyboard inputs.
In native mode, many web features like layout measurement are disabled, and focus management is restricted, requiring careful handling and syncing with native systems.