Skip to main content

Basic Menu API

Initialization

<script>
import { Menu } from "@svar-ui/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

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