Astryx

Astryx Context Menu

Component

About

A context menu that appears on right-click at the cursor position. Wraps trigger content as children. Astryx by Meta. Source: https://astryx.atmeta.com/components/ContextMenu

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Context Menu to your project and fits it to your theme.

Code

How Astryx Context Menu is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

'use client';

/* Copyright (c) 2026 Meta Platforms, Inc. See MIT notice in astryx-context-menu.tsx. */

import '@/components/ui/astryx-context-menu-utils/astryx-preview.css';
import {ContextMenu} from '@/components/ui/astryx-context-menu';

function OfficialSample() {
  return (
    <ContextMenu
      presentation="adaptive"
      items={[
        {label: 'Cut', onClick: () => {}},
        {label: 'Copy', onClick: () => {}},
        {label: 'Paste', onClick: () => {}},
        {type: 'divider'},
        {label: 'Delete', onClick: () => {}},
      ]}>
      <div
        style={{
          padding: '48px',
          borderWidth: '2px',
          borderStyle: 'dashed',
          borderColor: 'var(--color-border-emphasized)',
          borderRadius: '8px',
          textAlign: 'center',
          color: 'var(--color-text-secondary)',
          userSelect: 'none',
        }}>
        Long-press or right-click this area
      </div>
    </ContextMenu>
  );
}

export default function Demo() {
  return (
    <div className="astryx-demo" data-astryx-theme="neutral" data-theme="light">
      <div className="astryx-demo-content" data-centered style={{maxWidth: 400}}>
        <OfficialSample />
      </div>
    </div>
  );
}

Dependencies

More by Astryx

View all
  • Astryx Banner

    Astryx Banner

    61
  • Astryx Avatar

    Astryx Avatar

    34
  • Astryx Aspect Ratio

    Astryx Aspect Ratio

    32
  • Astryx Badge

    Astryx Badge

    30
  • Astryx Button Group

    Astryx Button Group

    29
  • Astryx Chat Composer Drawer

    Astryx Chat Composer Drawer

    27
  • Astryx Toggle Button

    Astryx Toggle Button

    17
  • Astryx Chat Tokenized Text

    Astryx Chat Tokenized Text

    10