Menu
An interactive list of <MenuItem>s
Code
<script lang="ts">
import { Menu } from '@geoffcox/sterling-svelte';
</script>
<Menu>
<!-- <MenuItem> ... -->
</Menu>
Members
| Property Name | Type | Default | Comment | | variant | string | '' |
| Method Name | Parameters | Return Type | Comment | | focusFirstMenuItem | | |
| focusPreviousMenuItem | | |
| focusNextMenuItem | | |
| focusLastMenuItem | | |
Considerations
- Menu is a building block for the other menu components: MenuBar, MenuButton, MenuItem, MenuSeparator.
- Position is based on the reference element.
- The menu floats above other elements on the page via portal.
- Includes HTMLDivElement props, event, and methods
Anatomy
<div class="sterling-menu">
<div class="menu-items">
<slot {variant} />
</div>
</div>