sterling-svelte  2.0.0
A modern, accessible, lightweight UI component library for Svelte.

Tooltip

A floating box of content that is automatically shown when the mouse hovers over a reference element.

Code
<script lang="ts">
  import { Tooltip } from '@geoffcox/sterling-svelte';
</script>

<Tooltip hoverDelayMilliseconds="1000" open {reference}>
  <!-- TODO: the reference element -->
  {#snippet tip()}
    <!-- TODO: the tip content -->
  {/snippet}
</Tooltip>

Members

Property NameTypeDefaultComment
disabledboolean | null | undefinedfalseWhen true, the tooltip is disabled and will not be shown.
hoverDelayMillisecondsnumber | undefined1000 (1 second)The duration of mouse hover before showing the tooltip.
tipstring | Snippet | undefinedundefinedThe content passed to <Callout> children.

Considerations

  • Includes <Callout> props, events, and methods.

Anatomy

children (Snippet>)
  reference (<div>)
  callout (<Callout>)