![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@highlight-ui/dropdown-menu
Advanced tools
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';
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>
);
}
Prop | Type | Required | Default | Description |
---|---|---|---|---|
open | boolean | No | false | Whether the dropdown is open or not |
defaultValue | boolean | No | false | Default open value |
className | string | No | Allows providing a custom class name to the DIV element that surrounds the text | |
closeOnClickAnywhere | boolean | No | false | Enables closing the dropdown menu when clicking inside |
disabled | boolean | No | false | Prevents the open state of the dropdown menu from changing (Only works when the open prop is not being used) |
onChange | () => void | No | Callback triggered whenever the open state of the dropdown menu is changed (Only works when the open prop is not being used) | |
onClose | () => void | No | Callback triggered whenever the dropdown menu is closed (Only works when the open prop is not being used) | |
onOpen | () => void | No | Callback triggered whenever the dropdown menu is opened (Only works when the open prop is not being used) | |
onRequestToChange | () => void | No | Callback triggered when the open state of the dropdown menu is about to change (Only works when the open prop is in use) |
Prop | Type | Required | Default | Description |
---|---|---|---|---|
className | string | No | Allows providing a custom class name to the toggle | |
disabled | boolean | No | false | Prevents the open state of the dropdown menu from changing |
onToggle | () => void | No | Callback triggered whenever the open state of the dropdown menu is changed |
Prop | Type | Required | Default | Description |
---|---|---|---|---|
open | boolean | No | false | Whether the dropdown is open or not |
className | string | No | Allows providing a custom class name to the list | |
containerWidth | number | No | 0 | The max width of the container |
direction | 'bottom-left', 'bottom-right', 'center', 'top-left', 'top-right' | No | bottom-right | The direction that the menu should open from - relative to the trigger |
onToggle | () => void | No | Callback triggered whenever the open state of the dropdown menu is changed | |
preventToCloseOnClick | boolean | No | false | Prevents the close on click |
title | string | No | Gives this dropdown a title |
The DropdownMenuItem gets its props from the
a
andbutton
types.
Please visit personio.design for usage guidelines and visual examples.
If you're interested in contributing, please visit our contribution page.
FAQs
Dropdown Menu Component
The npm package @highlight-ui/dropdown-menu receives a total of 608 weekly downloads. As such, @highlight-ui/dropdown-menu popularity was classified as not popular.
We found that @highlight-ui/dropdown-menu demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.