Installation
Recommended: React Package
For React applications, install the hooks-based package:
npm install @noriginmedia/norigin-spatial-navigation-core @noriginmedia/norigin-spatial-navigation-react
yarn add @noriginmedia/norigin-spatial-navigation-core @noriginmedia/norigin-spatial-navigation-react
Peer dependency: React >= 16.8.0
This package exports useFocusable, FocusContext, and all type definitions you need.
React Native TV
For React Native TV apps (Android TV, Apple TV, and similar targets), install the package that bundles the React hooks and the TV layout adapter:
npm install @noriginmedia/norigin-spatial-navigation-react-native-tvos
yarn add @noriginmedia/norigin-spatial-navigation-react-native-tvos
Peer dependencies: React >= 16.8.0 and React Native >= 0.73.7.
This package depends on react-native-tvos as the React Native fork.
See React Native TV for initialization and adapter usage.
Core Package (Framework-Agnostic)
If you need the navigation service without React bindings:
npm install @noriginmedia/norigin-spatial-navigation-core
This package exports the SpatialNavigation singleton and its types. You manage component registration yourself by calling addFocusable and removeFocusable directly.
Legacy Combined Package
If you are upgrading from an older version of the library:
npm install @noriginmedia/norigin-spatial-navigation
This package re-exports everything from both core and react. It exists for backwards compatibility. New projects should use the specific packages above.
TypeScript
All packages ship with bundled TypeScript declarations. No separate @types/ package is needed.