svelte-context-action
v0.0.4
Published
Svelte context action provides a svelte action to create highly configurable context/right click menus.
Downloads
2
Readme
svelte-context-action
Svelte context action provides a svelte action to create highly configurable context/right click menus.
Installation
$ npm install svelte-context-action
$ yarn add svelte-context-action
$ pnpm add svelte-context-action
Usage
<script>
import { contextMenu } from 'svelte-context-action';
</script>
<div
use:contextMenu={{
items: [
{
type: 'button',
content: 'Hello world',
callback: () => window.alert('hi')
},
{
type: 'button',
content: 'Hi 1',
callback: () => window.alert('hi')
},
{
type: 'divider'
},
{
type: 'button',
content: 'Hi 2',
callback: () => window.alert('hi')
}
],
}}
>
Right click me!
</div>
Documentation
Documentation is available using a GitHub Wiki here.