sterling-svelte  2.0.0
A modern, accessible, lightweight UI component library for Svelte.

Menu

An interactive list of menu items.

Code
<script lang="ts">
  import { Menu } from '@geoffcox/sterling-svelte';
</script>

<Menu>
  <!-- <MenuItem> ... -->
</Menu>

Members

Method NameParametersReturn TypeComment
focusFirstMenuItemFocuses the first menu item.
focusPreviousMenuItemFocuses the previous menu item.
focusNextMenuItemFocuses the next menu item.
focusLastMenuItemFocuses the last menu item.

Considerations

  • Menu is a building block for a hierarchy of others components such as MenuBar, MenuButton, MenuItem, and MenuSeparator.
  • Position is based on the reference element.
  • The menu floats above other elements on the page via portal.
  • Includes HTMLDivElement props, events, and methods.

Anatomy

menu (<div>)
  menu items (<div>)
    children (Snippet)