Skip to content

ACV Popper

Short description for Popper component...

Basic usage

Source code
vue
<script setup>
  import AcvButton from '@/components/button/button.vue';
  import Popper from '@/components/popper/popper.vue';
  import { ref } from 'vue';

  const popperVisible = ref(false);
</script>

<template>
  <AcvButton @click="popperVisible = !popperVisible">
    Toggle
  </AcvButton>
  <Popper
    v-model="popperVisible"
    class="popper"
    :offset="6"
    arrow
  >
    <AcvButton>Popper</AcvButton>
    <template #content>
      Lorem ipsum dolor sit amet, consectet adipisicing elit.
    </template>
  </Popper>
</template>

<style scoped>
.acv-popper {
  background-color: hsl(28deg 100% 97%);
  border: 1px solid hsl(0deg 0% 0%);
  padding: 8px;
}
</style>

Props

Prop nameDescriptionTypeValuesDefault
referenceElReference element for the Popper
By default, it is the parent element or default slot element
HTMLElement | null | undefined-
modelValueShow/Hide Popper base on v-model valueboolean-undefined
persistPersistence of Popper when clicked outside of reference elementboolean | "content"-false
triggerTrigger event to open the Popper"click" | "hover"'click', 'hover''click'
delayDelay before showing Popper
in milliseconds
number-0
hideDelayDelay before hiding Poppernumber-0
transitionTransition to add while showing/hiding PopperAcvPopperTransitions-'fade'
teleportWhether the Popper is teleportedboolean-false
disabledWhether the Popper is disabledboolean-false
widthWidth of the Popperstring | number-
placementPlacement of the Popper
Floating UI
PopperPlacement-'bottom-start'
strategyStrategy of the appearance of the Popper"absolute" | "fixed"-
middlewareWhether to use transform for positioning
Floating UI
Middleware-
offsetOffset of the Popper
Floating UI
number-0
arrowWhether to show the arrowboolean-false
flipChanges the placement of the floating element to keep it in view.
Floating UI
boolean-false
popperClassstring-

Events

Event namePropertiesDescription
update:modelValueeventName string - The name of the event
value boolean - The visibility state of the component
Triggered when the component is toggled
hideeventName string - undefinedTriggered when the component is hidden
showeventName mixed - undefinedTriggered when the component is shown

Slots

NameDescriptionBindings
defaultThe default slot content, reference, anchor element
contentThe content slot
arrowArrow slot content

MIT Licensed