Files
gpx.studio/website/src/lib/components/Tooltip.svelte

21 lines
590 B
Svelte
Raw Normal View History

2024-04-19 16:13:08 +02:00
<script lang="ts">
import * as Tooltip from '$lib/components/ui/tooltip/index.js';
export let label: string;
export let side: 'top' | 'right' | 'bottom' | 'left' = 'top';
2024-04-19 16:13:08 +02:00
</script>
2025-06-21 21:07:36 +02:00
<Tooltip.Provider>
<Tooltip.Root>
<Tooltip.Trigger {...$$restProps} aria-label={label}>
<slot />
</Tooltip.Trigger>
<Tooltip.Content {side}>
<div class="flex flex-row items-center">
<span>{label}</span>
<slot name="extra" />
</div>
</Tooltip.Content>
</Tooltip.Root>
</Tooltip.Provider>