Person preview
Show brief contextual information without opening a full profile.
Components / Overlays
A preview panel opened by hover, focus, or click.
Last changed in version 0.13.0: Add avatar groups and chips, expand the block gallery, and improve component colors, spacing, and motion.
bunx --bun @getweini/cli@latest add hover-cardImport the files copied by the install command, then place the component in your Vue template. The text and values in the example belong to your app; change them to fit your task.
<script setup lang="ts">
import HoverCard from './components/ui/hover-card/HoverCard.vue'
</script>
<template>
<HoverCard trigger="Project details" label="Project preview">
<strong>Design system</strong>
<p>Shared components and tokens</p>
</HoverCard>
</template>The panel triangle points to its trigger, including when the panel flips near a viewport edge. Use a button for previews that must work on touch. Escape closes and restores trigger focus; custom triggers bind all provided props.
Show brief contextual information without opening a full profile.
Let readers inspect metadata while keeping the underlying navigation available.
The trigger remains a button and the panel has its own name.
<script setup lang="ts">
import HoverCard from './components/ui/hover-card/HoverCard.vue'
</script>
<template>
<HoverCard trigger="Avery Lee" label="Avery Lee profile preview">
<h3>Avery Lee</h3>
<p>Design lead · Luxembourg</p>
</HoverCard>
</template>Align a wider card with its trigger.
<script setup lang="ts">
import HoverCard from './components/ui/hover-card/HoverCard.vue'
</script>
<template>
<HoverCard
trigger="Design system"
label="Design system preview"
:width="360"
align="start"
side="bottom"
>
<h3>Design system</h3>
<p>Shared components, patterns, and tokens.</p>
</HoverCard>
</template>Every public prop, model, event, slot, and exposed member of the installed Vue parts is listed below. “Not set” means you can leave that value out; “Required” means you must provide it. Native HTML attributes also work where the component uses a native element.
| Name | Type or signature | Default | What it does |
|---|---|---|---|
labelprop | string | Required | Visible or accessible name for this item. |
triggerprop | string | undefined | Not set | Element or interaction that opens this content. |
disabledprop | boolean | undefined | Not set | Prevent interaction and show the disabled state. |
openDelayprop | number | undefined | 500 | Time to wait before opening after pointer hover. |
closeDelayprop | number | undefined | 200 | Time to wait before closing after the pointer leaves. |
widthprop | number | undefined | 320 | Choose the width of this content. |
gapprop | number | undefined | 12 | Space in pixels between the trigger and floating content. |
alignprop | "start" | "end" | "center" | undefined | "center" | Choose how content aligns within its container. |
sideprop | "top" | "bottom" | undefined | "bottom" | Choose the side on which this content appears. |
openmodel | boolean | undefined | false | Current open state. Use v-model:open to keep it in sync with your page. |
update:openevent | [value: boolean] | — | Requests a new open value from the parent. |
triggerslot | { props: { ref: (value: TriggerElement) => void; 'aria-haspopup': "dialog"; 'aria-expanded': boolean; 'aria-controls': string | undefined; onPointerenter: (event: PointerEvent) => void; onPointerleave: (event: PointerEvent) => void; onFocusin: () => void; onFocusout: (event: FocusEvent) => void; onClick: () => void; onKeydown: (event: KeyboardEvent) => void; }; open: boolean; } | Optional | Content for the trigger area of HoverCard. |
defaultslot | {} | Optional | Content shown inside HoverCard. |
openexposed | () => void | — | Open this component from application code. |
closeexposed | () => void | — | Close this component from application code. |
// packages/frameworks/vue/components/hover-card/types.ts
export interface HoverCardProps {
label: string
trigger?: string
disabled?: boolean
openDelay?: number
closeDelay?: number
width?: number
gap?: number
align?: 'start' | 'center' | 'end'
side?: 'top' | 'bottom'
}