Components
Popover Menu
A popover menu with a header, avatar, and navigation items.
UiPopoverMenu shows a dropdown panel with an optional user header (title, subtitle, avatar) and a list of navigation items.
Add a popover menu
<script setup lang="ts">
import type { INavItem } from '@colorffy/ui'
import { ref } from 'vue'
const open = ref(false)
const menuItems: INavItem[] = [
{ id: 'settings', to: '/settings', icon: '', text: 'Settings', ariaLabel: 'Settings' },
{ id: 'logout', to: '/logout', icon: '', text: 'Log out', ariaLabel: 'Log out' },
]
</script>
<template>
<UiPopoverMenu
:is-opened="open"
:menu-items="menuItems"
title="Jane Doe"
subtitle="jane@example.com"
avatar-url="/jane.jpg"
@hide-dropdown="open = false"
@menu-item-click="to => navigateTo(to)"
/>
</template>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
isOpened | boolean | false | Show / hide the menu. |
menuItems | INavItem[] | — | Menu entries. |
title / subtitle | string | null | — | Header text. |
avatarUrl | string | null | — | Header avatar image. |
currentRoute | { path?, name? } | null | — | For active-link detection (pass useRoute()). |
user | { displayName, email, photoURL } | null | — | Convenience user object. |
Emits: hideDropdown, menuItemClick(to).