Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dropshift

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dropshift

render prop pattern, accessible link menus

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Dropshift

Inspired by Downshift, this library intends to provide solutions for people wanting to add accessible navigation dropdowns to their apps.

Why not Downshift?

Downshift works primarily as a combobox, that is to say, a text input and a select input combined. As such it, at the very least, expects a list of items, from which one can 'select' an item. These behaviours collide with user expectations when dealing with a navigation dropdown. Link items should focus when tabbing through the page, unlike Downshift, which uses arrow-keys for item to item navigation. This library is meant for non-selectable items (actionable items) and does not intend to support complexities like nested dropdown lists.

NPM JavaScript Style Guide

Install

npm install --save dropshift

Usage

import React, { Component, Fragment } from 'react'

import Dropshift from 'dropshift'

class Example extends Component {
  render () {
    return (
      <Dropshift>
        {
          ({getToggleButtonProps, getMenuProps, isOpen}) => (
            <Fragment>
              <button {...getToggleButtonProps()}>
                Menu
              </button>
              <nav {...getMenuProps()}>
              //...links here
              </nav>
            </Fragment>
          )
        }
      </Dropshift>
    )
  }
}

License

MIT © vidjuheffex

FAQs

Package last updated on 29 Jan 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc