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

@paprika/dropdown-menu

Package Overview
Dependencies
Maintainers
2
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paprika/dropdown-menu

DropdownMenu component

  • 0.1.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
376
decreased by-28.92%
Maintainers
2
Weekly downloads
 
Created
Source

DropdownMenu

The <DropdownMenu> component displays a trigger button, which when clicked displays a list of items in a dropdown format. These items can be raw content, Links or actions such as Delete, which will prompt a confirmation panel to be displayed

Installation

> npm install --save @paprika/dropdown-menu or > yarn add @paprika/dropdown-menu

Usage

import DropdownMenu from "@paprika/dropdown-menu";

<DropdownMenu
  renderTrigger={({ isOpen, handleOpenMenu }) => (
    <DropdownMenu.Trigger isOpen={isOpen} handleOpenMenu={handleOpenMenu}>
      Trigger
    </DropdownMenu.Trigger>
  )}
>
  <DropdownMenu.Item onClick={() => {}}>Edit</DropdownMenu.Item>
  <DropdownMenu.LinkItem isExternal link="http://www.wegalvanize.com">
    External link
  </DropdownMenu.LinkItem>
  <DropdownMenu.Item isDisabled onClick={() => {}}>
    Disabled Item
  </DropdownMenu.Item>
  <DropdownMenu.Divider />
  <DropdownMenu.Item
    isDestructive
    renderConfirmation={onClose => {
      return (
        <DropdownMenu.Confirmation
          confirmLabel="Delete filter"
          description="Lorem ipsum dolor amet vexillologist tacos selvage narwhal butcher twee ethical hot chicken"
          onConfirm={() => handleConfirm(onClose)}
          onCancel={() => handleCancel(onClose)}
          heading="Delete filter?"
        />
      );
    }}
  >
    Delete filter
  </DropdownMenu.Item>
</DropdownMenu>;

Props

  • align
  • children
  • renderTrigger

More detail about these props

DropdownMenu.Trigger
  • isOpen
  • handleOpenMenu

More detail about these props

DropdownMenu.Item
  • children
  • isDestructive
  • onClick
  • onClose
  • onShowConfirmation
  • renderConfirmation

More detail about these props

DropdownMenu.LinkItem
  • children
  • link
  • isExternal

More detail about these props

DropdownMenu.Divider

More detail about this component

DropdownMenu.Confirmation
  • buttonSize
  • confirmButtonType
  • confirmLabel
  • description
  • onCancel
  • onClose
  • onConfirm
  • heading

More detail about these props

FAQs

Package last updated on 25 Aug 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

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