svelte-context-action
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i svelte-context-action

Weekly Downloads

1

Version

0.0.4

License

none

Unpacked Size

27.9 kB

Total Files

17

Last publish

Collaborators

  • dlurak