components/context-menu-content.svelte

bits-ui · packages/bits-ui/src/lib/bits/context-menu/components/context-menu-content.svelte · svelte · MIT
ui

A headless context menu content component that manages positioning, accessibility, and interaction events for context menus in Svelte applications.

<!--
  Source: https://github.com/huntabyte/bits-ui | License: MIT | Copyright 2024 Hunter Johnston <https://github.com/huntabyte>
  Provided via justclaw.it.com; keep this notice with the code.
-->
<script lang="ts">
	import { getEventTargetClosest } from "#lib/internal/events.js";
	import { boxWith, mergeProps } from "svelte-toolbelt";
	import type { ContextMenuContentProps } from "../types.js";
	import { MenuContentState } from "#lib/bits/menu/menu.svelte.js";
	import { CONTEXT_MENU_TRIGGER_ATTR } from "#lib/bits/menu/context-menu-attributes.js";
	import { useId } from "#lib/internal/use-id.js";
	import { noop } from "#lib/internal/noop.js";
	import PopperLayer from "#lib/bits/utilities/popper-layer/popper-layer.svelte";
	import { getFloatingContentCSSVars } from "#lib/internal/floating

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key