Skip to main content

Basic Menu API

Initialization

<script>
import { Menu } from "wx-svelte-menu";

import { getOptions } from "./data";

const options = getOptions();
</script>

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

Properties

atspecifies the position of the menu relative to the target node
contexta context object related to the clicked menu item
leftsets the left offset of a menu in pixels
mountattaches Menu to a custom Portal
optionsa set of menu options
parentan optional HTML reference used as a menu parent
topsets the top offset of a menu in pixels

Events

clickfires on clicking a menu item or outside the menu