aboutsummaryrefslogtreecommitdiff
path: root/src/ui/c-tooltip/c-tooltip.demo.vue
blob: edd1364a07f3ad71dc54c33eb234342f9fa338ef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<script lang="ts" setup>
const positions = ['top', 'bottom', 'left', 'right'] as const;
</script>

<template>
  <div>
    <c-tooltip>
      Hover me

      <template #tooltip>
        Tooltip content
      </template>
    </c-tooltip>
  </div>

  <div mt-5>
    <c-tooltip tooltip="Tooltip content">
      Hover me
    </c-tooltip>
  </div>

  <div mt-5>
    <h2>Tooltip positions</h2>

    <div class="flex flex-wrap gap-4">
      <div v-for="position in positions" :key="position">
        <c-tooltip :position="position" :tooltip="`Tooltip ${position}`">
          <c-button>
            {{ position }}
          </c-button>
        </c-tooltip>
      </div>
    </div>
  </div>
</template>