components/tooltip-provider.svelte

bits-ui · packages/bits-ui/src/lib/bits/tooltip/components/tooltip-provider.svelte · svelte · MIT
ui

Manages global tooltip configuration and state via context to ensure consistent behavior across all tooltip instances.

<!--
  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 { boxWith } from "svelte-toolbelt";
	import type { TooltipProviderProps } from "../types.js";
	import { TooltipProviderState } from "../tooltip.svelte.js";

	let {
		children,
		delayDuration = 700,
		disableCloseOnTriggerClick = false,
		disableHoverableContent = false,
		disabled = false,
		ignoreNonKeyboardFocus = false,
		skipDelayDuration = 300,
	}: TooltipProviderProps = $props();

	TooltipProviderState.create({
		delayDuration: boxWith(() => delayDuration),
		disableCloseOnTriggerClick: boxWith(() => disableCloseOnTriggerClick),
		disableHoverableContent: boxWi

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

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

Get a free API key