feat: 实现Tooltip组件

This commit is contained in:
2025-12-25 15:44:48 +08:00
parent 4378d85fe8
commit 955dc99119
4 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,16 @@
<script lang="ts">
import { Tooltip as BitsTooltip, type WithoutChildren } from 'bits-ui';
import type { Snippet } from 'svelte';
type Props = WithoutChildren<BitsTooltip.RootProps> & {
children?: Snippet;
};
let { children, ...restProps }: Props = $props();
</script>
<BitsTooltip.Provider delayDuration={0}>
<BitsTooltip.Root {...restProps}>
{@render children?.()}
</BitsTooltip.Root>
</BitsTooltip.Provider>