Context Menu

A right-click menu of actions, sharing the dropdown menu's item set.

Installation

Copy the command below and run it in your terminal.

bunx @sivir/ui add context-menu

Usage

Import and compose with Root, Trigger, Content, and Item:

import * as ContextMenu from '$lib/sivir/components/context-menu';

<ContextMenu.Root>
  <ContextMenu.Trigger>
    <div>Right-click me</div>
  </ContextMenu.Trigger>
  <ContextMenu.Content>
    <ContextMenu.Item callback={handleAction}>Action</ContextMenu.Item>
  </ContextMenu.Content>
</ContextMenu.Root>

Examples

Right-click each surface below. Each one ships a different context menu.

File row

Image

Task card