
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
chakra-ui-contextmenu
Advanced tools
Context Menu component for Chakra UI
Checkout the storybook for more examples!
To start using chakra-ui-contextmenu, install it to your project as a dependency via
npm install chakra-ui-contextmenu
then import it and add your context menu component with
import { ContextMenu } from 'chakra-ui-contextmenu';
import { Box, Button, ChakraProvider } from '@chakra-ui/react';
import { MenuList, MenuItem } from '@chakra-ui/menu';
render(
<ContextMenu
renderMenu={() => (
<MenuList>
<MenuItem>Context Menu Item 1</MenuItem>
<MenuItem>Context Menu Item 2</MenuItem>
</MenuList>
)}
>
{ref => <div ref={ref}>Target</div>}
</ContextMenu>
);
When using Typescript, you can type the context menu component with the kind of target component to get better typings:
render(
<ContextMenu<HTMLDivElement>
renderMenu={() => (
<MenuList>
<MenuItem>Context Menu Item 1</MenuItem>
<MenuItem>Context Menu Item 2</MenuItem>
</MenuList>
)}
>
{ref => <div ref={ref}>Target</div>}
</ContextMenu>
);
The ContextMenu
component provides the following props:
export interface ContextMenuProps<T extends HTMLElement> {
renderMenu: () => JSX.Element | null;
children: (ref: MutableRefObject<T | null>) => JSX.Element | null;
menuProps?: MenuProps;
portalProps?: PortalProps;
menuButtonProps?: MenuButtonProps;
}
FAQs
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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.