WlTooltip
Change props to see the result: the example and code use the same settings. “Reset” restores the initial values.
Settings
Preferred overlay side relative to its anchor.
Tooltip text when the content slot is not supplied.
Delay in milliseconds before showing the tooltip.
Delay in milliseconds before hiding the tooltip.
Disable user interaction with this component.
Enable motion locally, with application defaults and reduced-motion preferences respected.
Props pt, models, handlers and slots can be edited in the SFC. See their descriptions in API.
Example
Focus or hover shows the tooltip; Escape hides it without moving focus. A disabled trigger needs a focusable wrapper.
Explore the live example and copy its Vue SFC into your application. Settings on the left can be combined.
Code for your application
Vue SFC · current settings
<script setup lang="ts">
import { WlButton, WlTooltip } from "legato-ui";
import { ref } from "vue";
const visible = ref(false);
</script>
<template>
<div class="wl-stack" data-space="md" data-review-example="WlTooltip">
<div class="wl-inline" data-space="md">
<WlTooltip v-model:visible="visible" >
<WlButton size="sm">{{ "Save details" }}</WlButton>
<template #content><strong>{{ "Changes are saved automatically." }}</strong></template>
</WlTooltip>
<WlTooltip content="This action requires editor access.">
<WlButton size="sm" disabled>{{ "Delete (unavailable)" }}</WlButton>
</WlTooltip>
<WlButton size="sm" @click="visible = !visible">{{ "Toggle tooltip" }}</WlButton>
</div>
<p class="wl-text-small">{{ "Focus or hover shows the tooltip; Escape hides it without moving focus. A disabled trigger needs a focusable wrapper." }}</p>
</div>
</template>Descriptions on hover and focus
Descriptive hover and focus content with an optional controlled visibility model.
Focus or hover shows the tooltip; Escape hides it without moving focus. A disabled trigger needs a focusable wrapper.
Vue SFC · additional example
<script setup lang="ts">
import { WlButton, WlTooltip } from "legato-ui";
import { ref } from "vue";
const visible = ref(false);
</script>
<template>
<div class="wl-stack" data-space="md" data-review-example="WlTooltip">
<div class="wl-inline" data-space="md">
<WlTooltip v-model:visible="visible" >
<WlButton size="sm">{{ "Save details" }}</WlButton>
<template #content><strong>{{ "Changes are saved automatically." }}</strong></template>
</WlTooltip>
<WlTooltip content="This action requires editor access.">
<WlButton size="sm" disabled>{{ "Delete (unavailable)" }}</WlButton>
</WlTooltip>
<WlButton size="sm" @click="visible = !visible">{{ "Toggle tooltip" }}</WlButton>
</div>
<p class="wl-text-small">{{ "Focus or hover shows the tooltip; Escape hides it without moving focus. A disabled trigger needs a focusable wrapper." }}</p>
</div>
</template>