Home

contextmenus

Context menus, also called contextual menus, are pop-up menus that appear in response to a user action such as a right-click, long-press, or keyboard shortcut. They present actions that are relevant to the item or area under the cursor, offering quick access to operations like copy, paste, rename, open, delete, or properties. Because the available actions depend on context, the contents of a context menu are usually dynamic and may change when the user selects a different element.

A typical context menu is hierarchical, with separators to group items, enabled or disabled states for items,

Implementation varies by platform. In web applications, the menu is often rendered by client-side code in response

Accessibility considerations include ensuring proper focus management, using appropriate ARIA roles, and providing descriptive labels for

Overall, context menus provide fast, context-sensitive access to actions, but should be used sparingly, follow platform

and
optional
submenus
or
checkable
items.
Some
implementations
support
keyboard
navigation
and
accessibility
features,
allowing
users
to
open
the
menu
with
a
keyboard,
traverse
items
with
arrow
keys,
activate
with
Enter,
and
dismiss
with
Escape.
to
a
contextmenu
event,
positioned
near
the
cursor
and
constrained
to
the
viewport.
On
desktop
operating
systems,
the
system
or
app-defined
menus
follow
platform
conventions
for
appearance
and
item
ordering.
On
touch
devices,
long-press
usually
triggers
the
menu,
and
the
design
should
avoid
obstructing
critical
content.
screen
readers.
Context
menus
should
be
discoverable,
and
alternative,
always-visible
options
may
be
offered
to
accommodate
users
who
cannot
use
pointer-based
interactions.
conventions,
and
be
reachable
by
all
users.