Skip to content

Conversation

@J-Sek
Copy link
Contributor

@J-Sek J-Sek commented Oct 24, 2025

follow-up after #22233

lets users control viewport margin without forcing them to use stick-to-target

Markup:

<template>
  <v-app theme="dark">
    <v-container style="height: 200vh" fluid>
      <v-btn class="top-0 left-0" position="absolute">
        only 40px margin
        <v-tooltip
          activator="parent"
          location="bottom center"
          text="Tooltip very long text which will overflow and be outside the window"
          viewport-margin="40"
          model-value
        />
      </v-btn>
      <v-btn class="top-0 right-0" position="absolute">
        only 24px margin
        <v-tooltip
          activator="parent"
          location="bottom center"
          text="Tooltip very long text which will overflow and be outside the window"
          viewport-margin="24"
          model-value
        />
      </v-btn>
      <v-btn class="bottom-0 left-0" position="absolute">
        stick-to-target + 24px margin
        <v-tooltip
          activator="parent"
          location="bottom center"
          text="Tooltip very long text which will overflow and be outside the window"
          viewport-margin="24"
          model-value
          stick-to-target
        />
      </v-btn>
      <v-btn class="bottom-0 right-0" position="absolute">
        stick-to-target + 24px margin
        <v-tooltip
          activator="parent"
          location="bottom center"
          text="Tooltip very long text which will overflow and be outside the window"
          viewport-margin="24"
          model-value
          stick-to-target
        />
      </v-btn>

      <v-sheet class="mx-auto mt-n12 pa-4 bg-purple" elevation="4" width="100">
        Default
        <v-tooltip
          activator="parent"
          location="right bottom"
          text="Tooltip very long text which will overflow and be outside the window"
          width="150"
          model-value
        />
      </v-sheet>

      <v-sheet class="mx-auto pa-4 bg-teal-darken-2" elevation="4" style="margin-top: calc(100vh)" width="150">
        stick-to-target + 6px margin
        <v-tooltip
          activator="parent"
          location="right center"
          text="Tooltip very long text which will overflow and be outside the window"
          viewport-margin="6"
          width="150"
          model-value
          stick-to-target
        />
      </v-sheet>
    </v-container>
  </v-app>
</template>

@J-Sek J-Sek self-assigned this Oct 24, 2025
@J-Sek J-Sek added T: enhancement Functionality that enhances existing features C: VOverlay labels Oct 24, 2025
@J-Sek J-Sek added this to the v3.11.0 milestone Oct 24, 2025
@J-Sek J-Sek changed the title feat(VOverlay): add viewport-margin prop feat(VOverlay): add viewport-margin prop Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: VOverlay T: enhancement Functionality that enhances existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants