Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spectrum-web-components/menu-item

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spectrum-web-components/menu-item

An `<sp-menu />` is used for creating a menu list. The various elements inside a menu are given as `<sp-menu-group/>`, `<sp-menu-item />`, or `<sp-menu-divider />`.

  • 0.1.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
decreased by-38.89%
Maintainers
2
Weekly downloads
 
Created
Source

Overview

An <sp-menu /> is used for creating a menu list. The various elements inside a menu are given as <sp-menu-group/>, <sp-menu-item />, or <sp-menu-divider />.

Variants

Menu Items

Menus are a collection of <sp-menu-items /> that can be modified to be disabled or selected.

<sp-menu>
    <sp-menu-item>
        Active Menu Item
    </sp-menu-item>
    <sp-menu-item disabled>
        Disabled Menu Item
    </sp-menu-item>
    <sp-menu-item selected>
        Selected Menu Item
    </sp-menu-item>
</sp-menu>

Organization

The content of a menu can be organized by either adding <sp-menu-divider /> elements to a flat list.

<sp-popover open style="position: relative">
    <sp-menu>
        <sp-menu-item>
            Menu Item 1a
        </sp-menu-item>
        <sp-menu-item>
            Menu Item 2a
        </sp-menu-item>
        <sp-menu-divider></sp-menu-divider>
        <sp-menu-item>
            Menu Item 3a
        </sp-menu-item>
        <sp-menu-item>
            Menu Item 1b
        </sp-menu-item>
        <sp-menu-divider></sp-menu-divider>
        <sp-menu-item>
            Menu Item 2b
        </sp-menu-item>
    </sp-menu>
</sp-popover>

Accessibility

<sp-menu />, <sp-menu-group />, and <sp-menu-item /> each deliver a different part of the wai-aria "menu" pattern and support the menu, group, and menuitem roles respectively. To support ease of keyboard navigation, only the first active or first selected <sp-menu-item /> can be accessed in the tab order. Once the focus has entered the menu the up and down arrow keys can be used to access the rest of the menu.

Keywords

FAQs

Package last updated on 14 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc