open-index/open-npm huggingface dataset:
npm package: @jeremymwan/svelte4-contextmenu
Description: (autogenerated) # Svelte 4 Context Menu
Latest version: 1.0.4

(autogenerated)
# Svelte 4 Context Menu

A customizable context menu and submenu component library for Svelte 4, supporting nested menus, dividers, and flexible option handling.

## Features

- **Context menus**: Right-click to open custom menus anywhere in your app.
- **Submenus**: Nested options with automatic boundary detection.
- **Dividers**: Visual separation between menu groups.
- **Custom actions**: Pass functions and arguments for each menu item.
- **Svelte stores**: Internal state management for active menus.

## Installation

```sh
npm install @jeremymwan/svelte4-contextmenu
```
## Usage
Import the components in your Svelte files:
```svelte
<script lang="ts">
  import { ContextMenu } from "@jeremymwan/svelte4-contextmenu";
  import type { ContextMenuOption } from "@jeremymwan/svelte4-contextmenu/dist/util/interfaces";
  import { dividerContextOption } from "@jeremymwan/svelte4-contextmenu/dist/util/dividerContextOption";

  let count = 0;
  function addCount(num = 1) { count += num; }
  // ...other handlers...

  const options: ContextMenuOption[] = [
    { name: 'Add', func: addCount, submenu: [/* ... */] },
    dividerContextOption,
    // ...other options...
  ];
</script>

<ContextMenu {options}>
  <div>
    <!-- Your content here -->
  </div>
</ContextMenu>
```
## API
`ContextMenu`
* `options`: Array of ContextMenuOption objects.
* `args`: Arguments passed to menu item functions.
* `isOpen`: Control menu visibility (optional).
* `useWindowBoundary`: Prevent menu overflow (optional).

`ContextMenuOption`
Used internally for nested menus.
ContextMenuOption
See ContextMenuOption for full type definition.
npm package: @jeremyrcox/hello-world
Description: <meta charset="utf-8"/>
Latest version: 0.1.0

<meta charset="utf-8"/>

# 🦀🕸️ `wasm-pack-template`

A template for kick starting a Rust and WebAssembly project using
[`wasm-pack`](https://github.com/rustwasm/wasm-pack).

This template is designed for compiling Rust libraries into WebAssembly and
publishing the resulting package to NPM.

* Want to use the published NPM package in a Website? [Check out
  `create-wasm-app`.](https://github.com/rustwasm/create-wasm-app)
* Want to make a monorepo-style Website without publishing to NPM? Check out
  [`rust-webpack-template`](https://github.com/rustwasm/rust-webpack-template)
  and/or
  [`rust-parcel-template`](https://github.com/rustwasm/rust-parcel-template).

## 🔋 Batteries Included

* [`wasm-bindgen`](https://github.com/rustwasm/wasm-bindgen) for communicating
  between WebAssembly and JavaScript.
* [`console_error_panic_hook`](https://github.com/rustwasm/console_error_panic_hook)
  for logging panic messages to the developer console.
* [`wee_alloc`](https://github.com/rustwasm/wee_alloc), an allocator optimized
  for small code size.

## 🚴 Usage

### 🐑 Use `cargo generate` to Clone this Template

[Learn more about `cargo generate` here.](https://github.com/ashleygwilliams/cargo-generate)

```
cargo generate --git https://github.com/rustwasm/wasm-pack-template.git --name my-project
cd my-project
```

### 🛠️ Build with `wasm-pack build`

```
wasm-pack build
```

### 🔬 Test in Headless Browsers with `wasm-pack test`

```
wasm-pack test --headless --firefox
```

### 🎁 Publish to NPM with `wasm-pack publish`

```
wasm-pack publish
```