Skip to main content

Basic Menu API

Initialization

import { Menu } from "@svar-ui/react-menu";
import { getOptions } from "./data";

export default function App() {
const options = getOptions();

return <Menu 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 the menu relative to the target node
contextOptional. A context object related to the clicked menu item
cssOptional. Adds a custom style to the menu
leftOptional. Sets the left offset of a menu in pixels
mountOptional. Attaches Menu to a custom Portal
optionsOptional. A set of menu options
parentOptional. An optional HTML reference used as a menu parent
topOptional. Sets the top offset of a menu in pixels

Events

clickFires on clicking a menu item or outside the menu