Skip to content
BigBang

Popular

    ↑↓Navigate↵OpenEscClose
    TR

    Components

    ContextMenu

    An action menu that opens at the pointer on right click or long press on an area.

    Storybook
    Storybook
    Source
    Source

    ContextMenu is built on Base UI Context Menu. The menu has the menu role and the items menuitem, menuitemcheckbox or menuitemradio. The area itself takes no role.

    While the menu is open:

    Key Behaviour
    Up, Down Move between items.
    Letter keys Move to the item that starts with that letter.
    Enter, Space Run the item.
    Right, Left Open or close a submenu.
    Escape Close the menu.

    Keyboard users may not be able to open the menu; the actions must also be reachable another way.

    When the menu opens, focus moves into it, and it returns to the area on close. The highlighted item takes the hover surface.

    Example Output
    Menu “menu”
    Item “Edit, menu item, Command E”

    Item text has 4.5:1 contrast on the raised surface; danger text 4.5:1.

    Criterion How ContextMenu meets it What the product team does
    2.1.1 Keyboard The open menu works with the keyboard. Offer the same actions in a DropdownMenu or with buttons.
    2.5.1 Pointer gestures A long press is a single-point gesture. -
    4.1.2 Name, role, value menu, menuitem. Write item names as verbs.