Context Menu

New

Контекстне меню при right-click.

Import

import { ContextMenu } from '@brutal-ui/react';

Basic Usage

Right-click here to see context menu

<ContextMenu
  items={[
    {
      label: 'Copy',
      icon: '📋',
      shortcut: 'Ctrl+C',
      onClick: () => console.log('Copy'),
    },
    { divider: true },
    {
      label: 'Delete',
      icon: '🗑️',
      onClick: () => console.log('Delete'),
    },
  ]}
>
  <Card>
    <CardContent>
      Right-click here
    </CardContent>
  </Card>
</ContextMenu>

Props

PropTypeDefaultDescription
itemsContextMenuItem[]-Menu items
childrenReactNode-Trigger element