ngx-spatial-navigation
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

ngx-spatial-navigation

Spatial Navigation in Angular

Installation

npm i ngx-spatial-navigation

Usage

Import the NgxSpatialNavigationModule module into your AppModule:

import { NgxSpatialNavigationModule } from "ngx-spatial-navigation";

@NgModule({
  imports: [NgxSpatialNavigationModule],
})
export class AppModule {}

Add the navRoot and navFocusable directives to your template:

<div navRoot>
  <div navFocusable>First element</div>
  <div navFocusable>Second element</div>
  <div navFocusable>Third element</div>
</div>

You can now navigate through the elements using the arrow keys on your keyboard.

API

navRoot

The navRoot directive is used to mark the root element where navigation will take place. There must be only one in the application.

navSection

The navSection directive is needed to combine elements into a section.

  • ignore - If true, the section element will not be considered focusable and will be skipped over.

navFocusable

The navFocusable directive is used to mark elements that can be focusable.

  • ignore - If true, the element will not be considered focusable and will be skipped over.

License

MIT. Copyright (c) Kyaw Swar Thwin <myanmarunicorn@gmail.com>

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i ngx-spatial-navigation

    Weekly Downloads

    0

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    74.1 kB

    Total Files

    19

    Last publish

    Collaborators

    • kyawswarthwin