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

@highlight-ui/dropdown-menu

Package Overview
Dependencies
Maintainers
10
Versions
153
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@highlight-ui/dropdown-menu

Dropdown Menu Component

  • 3.1.52
  • npm
  • Socket score

Version published
Weekly downloads
500
decreased by-40.26%
Maintainers
10
Weekly downloads
 
Created
Source

npm personio.design storybook.personio.design

@highlight-ui/dropdown-menu

Installation

Using npm:

npm install @highlight-ui/dropdown-menu

Using yarn:

yarn add @highlight-ui/dropdown-menu

Using pnpm:

pnpm install @highlight-ui/dropdown-menu

In your (S)CSS file:

@import url('@highlight-ui/dropdown-menu');

Once the package is installed, you can import the library:

import {
  DropdownMenu,
  DropdownMenuItem,
  DropdownMenuList,
  DropdownMenuToggle,
} from '@highlight-ui/dropdown-menu';

Usage

import React from 'react';
import {
  DropdownMenu,
  DropdownMenuToggle,
  DropdownMenuList,
  DropdownMenuItem,
} from '@highlight-ui/dropdown-menu';
import { Button } from '@highlight-ui/button';

export default function DropdownMenuExample() {
  return (
    <DropdownMenu>
      <DropdownMenuToggle>
        <Button buttonState={disabled ? 'disabled' : undefined}>
          Toggle Me!
        </Button>
      </DropdownMenuToggle>
      <DropdownMenuList direction={direction} title={title}>
        <DropdownMenuItem
          onClick={() => {
            console.log('clicked!');
          }}
        >
          Item label (as Button)
        </DropdownMenuItem>
        <DropdownMenuItem
          href="https://personio.com"
          target="_blank"
          rel="noopener noreferrer"
        >
          Item label (as Link)
        </DropdownMenuItem>
        <DropdownMenuItem disabled>Item label (disabled)</DropdownMenuItem>
      </DropdownMenuList>
    </DropdownMenu>
  );
}

Props 📜

DropdownMenu

PropTypeRequiredDefaultDescription
openbooleanNofalseWhether the dropdown is open or not
defaultValuebooleanNofalseDefault open value
classNamestringNoAllows providing a custom class name to the DIV element that surrounds the text
closeOnClickAnywherebooleanNofalseEnables closing the dropdown menu when clicking inside
disabledbooleanNofalsePrevents the open state of the dropdown menu from changing (Only works when the open prop is not being used)
onChange() => voidNoCallback triggered whenever the open state of the dropdown menu is changed (Only works when the open prop is not being used)
onClose() => voidNoCallback triggered whenever the dropdown menu is closed (Only works when the open prop is not being used)
onOpen() => voidNoCallback triggered whenever the dropdown menu is opened (Only works when the open prop is not being used)
onRequestToChange() => voidNoCallback triggered when the open state of the dropdown menu is about to change (Only works when the open prop is in use)

DropdownMenuToggle

PropTypeRequiredDefaultDescription
classNamestringNoAllows providing a custom class name to the toggle
disabledbooleanNofalsePrevents the open state of the dropdown menu from changing
onToggle() => voidNoCallback triggered whenever the open state of the dropdown menu is changed

DropdownMenuList

PropTypeRequiredDefaultDescription
openbooleanNofalseWhether the dropdown is open or not
classNamestringNoAllows providing a custom class name to the list
containerWidthnumberNo0The max width of the container
direction'bottom-left', 'bottom-right', 'center', 'top-left', 'top-right'Nobottom-rightThe direction that the menu should open from - relative to the trigger
onToggle() => voidNoCallback triggered whenever the open state of the dropdown menu is changed
preventToCloseOnClickbooleanNofalsePrevents the close on click
titlestringNoGives this dropdown a title

DropdownMenuItem

The DropdownMenuItem gets its props from the a and button types.

Contributing 🖌️

Please visit personio.design for usage guidelines and visual examples.

If you're interested in contributing, please visit our contribution page.

FAQs

Package last updated on 13 Jul 2023

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