diff --git a/docs/content/docs/2.components/popover.md b/docs/content/docs/2.components/popover.md
index 2d911808ef..46aae47f60 100644
--- a/docs/content/docs/2.components/popover.md
+++ b/docs/content/docs/2.components/popover.md
@@ -237,6 +237,10 @@ name: 'popover-anchor-slot-example'
:component-slots
+::note
+The `close` function is only available when `mode` is set to `click` because Reka UI exposes this for [`Popover`](https://reka-ui.com/docs/components/popover#close-using-slot-props) but not for [`HoverCard`](https://reka-ui.com/docs/components/hover-card).
+::
+
### Emits
:component-emits
diff --git a/playgrounds/nuxt/app/pages/components/popover.vue b/playgrounds/nuxt/app/pages/components/popover.vue
index ba9086ade2..3a70fd29bd 100644
--- a/playgrounds/nuxt/app/pages/components/popover.vue
+++ b/playgrounds/nuxt/app/pages/components/popover.vue
@@ -21,8 +21,10 @@ function send() {
-
-
+
+
+
+
diff --git a/src/runtime/components/Popover.vue b/src/runtime/components/Popover.vue
index 31e3ce8808..3e58f8f491 100644
--- a/src/runtime/components/Popover.vue
+++ b/src/runtime/components/Popover.vue
@@ -6,13 +6,14 @@ import type { EmitsToProps } from '../types/utils'
import type { ComponentConfig } from '../types/tv'
type Popover = ComponentConfig
+type PopoverMode = 'click' | 'hover'
-export interface PopoverProps extends PopoverRootProps, Pick {
+export interface PopoverProps extends PopoverRootProps, Pick {
/**
* The display mode of the popover.
* @defaultValue 'click'
*/
- mode?: 'click' | 'hover'
+ mode?: M
/**
* The content of the popover.
* @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
@@ -47,14 +48,16 @@ export interface PopoverEmits extends PopoverRootEmits {
'close:prevent': []
}
-export interface PopoverSlots {
+type SlotProps = [M] extends ['hover'] ? {} : { close: () => void }
+
+export interface PopoverSlots {
default(props: { open: boolean }): any
- content(props?: {}): any
- anchor(props?: {}): any
+ content(props: SlotProps): any
+ anchor(props: SlotProps): any
}
-
-
+
-
+
-
+