WlTooltip

Descriptive hover and focus content with an optional controlled visibility model.
Components / Feedback v1.0.0-rc.1

Placement

Focus or hover shows the tooltip; Escape hides it without moving focus. A disabled trigger needs a focusable wrapper.

Full 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>

Behavior

Focus or hover shows the tooltip; Escape hides it without moving focus. A disabled trigger needs a focusable wrapper.

Full 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>

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.

Full 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>