Save 15% on all Justd Blocks
Components

Context Menu

Opens a menu at the exact spot you right-click, providing quick access to relevant options.

beta

Basic

This component excels in desktop applications but has significant limitations. Its lack of accessibility and mobile compatibility are notable drawbacks. React Aria hasn't released an official version of this component yet, possibly due to these issues.

Unless it's absolutely necessary for your project, I'd advise against using it. For most scenarios requiring accessible, rich interfaces, consider alternatives like Menus or Popovers instead. These components typically offer better cross-platform support and accessibility features.

The initial release will be an alpha version due to ongoing issues with cursor positioning accuracy. If you're able to contribute, I'd appreciate your help in submitting a pull request to address this component's limitations.

Installation

If you hit any issues, make sure you check out the installation guide here for more information.

Composed Components

When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.

The Context Menu comes packed with several components to enhance functionality and provide a seamless experience.

A collapsible menu that reveals actions or navigation options when triggered, distinct from a select as it is not used for form input.

Manual Installation

Make sure you also install the composed components and the required packages for the component to function properly.

Item Details

You can add details to menu items by using the ContextMenuItemDetails component.

Danger

Designate a menu item as dangerous.

With Icon

Enhance context menu item by adding icons.

Separator

Separate context menu items with a separator.

Context Sub Menu

Sorry, this component doesn't exist yet. It's on our roadmap.

Disabled

Disable specific menu items.

Also, you can disable items directly in MenuContent by using the disabledKeys prop.

<ContextMenu.Content disabledKeys={['gsu']} />