8
Components

ContextMenu

A fully accessible and customizable context menu with options, checkboxes, and radio groups.

Introduction

The ContextMenu component provides a fully-featured, accessible context menu with support for dynamic options, checkboxes, and radio groups.


Default Use Case: Context Menu with Options

Right-click anywhere on this card


Installation

Install the ContextMenu component using the following command:

npx axionjs-ui add context-menu

File Structure


Prop Types

PropTypeDefault
children
React.ReactNode
-
onClick
(event: MouseEvent) => void
-
className
string
-
checked
boolean
-

Features

  • Dynamic Menu Options:
    • Create context menus with dynamic options, checkboxes, and radio groups.
  • Keyboard Navigation:
    • Full keyboard navigation support.
  • Built-In Accessibility:
    • Fully compliant with ARIA roles and attributes.

Conclusion

The ContextMenu component provides a flexible and accessible way to create context menus with advanced functionality, including multi-select options, radio groups, and customizable triggers.

On this page