New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-arrow-nav

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-arrow-nav

ArrowKey Navigation for react elements

latest
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

React Keyboard Navigation

A simple react component to enable keyboard navigation through it's child components.

Installation

yarn add react-arrow-nav

OR

npm install react-arrow-nav

Usage

Import Component

import ArrowNav from "react-arrow-nav";

class TodoItem extends React.Component {
  render() {
    <ArrowNav>
      <div>Item 1</div>
      <div>Item 2</div>
      <FancyItem>Item 3</FancyItem>
    </ArrowNav>;
  }
}

function FancyItem({ tabIndex, children }) {
  return (
    <button {...fancyProps} tabIndex={tabIndex}>
      {children}
    </button>
  );
}

Props

  • mode

    The direction of keyboard navigation.

    default : ArrowNav.VERTICAL

    values = [ ArrowNav.VERTICAL , ArrowNav.HORIZONTAL , ArrowNav.BOTH ]

  • ...any other prop will be passed to the wrapping div element.

If the child elements are not DOM elements, make sure they pass down tabIndex prop to the DOM element

Keywords

arrow

FAQs

Package last updated on 07 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts