Basic Menu API
Initialization
<script>
import { Menu } from "@svar-ui/svelte-menu";
import { getOptions } from "./data";
const options = getOptions();
</script>
<Menu {options}></Menu>
Related resources
- Visit the Features Guide to learn more about the widget's functionality.
- Explore the samples to visualize the available features.
Properties
at | Optional. Specifies the position of the menu relative to the target node |
context | Optional. A context object related to the clicked menu item |
css | Optional. Adds a custom style to the menu |
left | Optional. Sets the left offset of a menu in pixels |
mount | Optional. Attaches Menu to a custom Portal |
options | Optional. A set of menu options |
parent | Optional. An optional HTML reference used as a menu parent |
top | Optional. Sets the top offset of a menu in pixels |
Events
click | Fires on clicking a menu item or outside the menu |