Skip to main content

Context Menu API

Initialization

import { useState } from "react";
import { ContextMenu } from "@svar-ui/react-menu";

import { getOptions } from "./data";

export default function Example() {
const [options] = useState(() => getOptions());

return <ContextMenu options={options} />;
}
  • Visit the Features Guide to learn more about the widget's functionality.
  • Explore the samples to visualize the available features.

Properties

atOptional. Specifies the position of Context Menu relative to the target node
cssOptional. Adds a custom style to the menu
dataKeyOptional. Specifies the id of the elements to show Context Menu for
filterOptional. Specifies what context to show for the specified targets
optionsOptional. Specifies a set of options for Context Menu
resolverOptional. Enables the multi-area mode and defines whether an element needs a menu

Events

clickFires on clicking an item of Context Menu or outside the menu