Skip to content

Popover ​

Displays rich content in a portal, triggered by a button.

Examples ​

Default ​

vue
<script setup>
import {
  Popover,
  PopoverContent,
  PopoverTrigger,
  Button
} from '@empathyds/vue'
</script>

<Popover>
  <PopoverTrigger as-child>
    <Button variant="outline">Open popover</Button>
  </PopoverTrigger>
  <PopoverContent class="w-80">
    <div class="grid gap-4">
      <div class="space-y-2">
        <h4 class="font-medium leading-none">Dimensions</h4>
        <p class="text-sm text-muted-foreground">
          Set the dimensions for the layer.
        </p>
      </div>
    </div>
  </PopoverContent>
</Popover>

Props ​

Popover ​

PropTypeDefaultDescription
defaultOpenbooleanfalseThe open state of the popover when it is initially rendered.
openboolean-The controlled open state of the popover.
modalbooleanfalseThe modality of the popover.

Events ​

Popover ​

EventPayloadDescription
update:openbooleanEvent handler called when the open state of the popover changes.

Slots ​

Popover ​

SlotDescription
defaultThe content of the popover.

PopoverTrigger ​

SlotDescription
defaultThe content of the trigger.

PopoverContent ​

SlotDescription
defaultThe items of the popover.