A shadcn-style hover card component built with Ark UI primitives.

Liked by @sarah_chen and 3 others.

Installation

npx shadcn@latest add @ark-cn/hover-card

Usage

import * as HoverCard from "@/components/ui/hover-card"

Read exported parts in src/components/ui/hover-card.tsx and compose the primitive according to the Ark UI pattern for this component.

Examples

Basic

Liked by @sarah_chen and 3 others.

Context Hook

Panel: closed

@sarah_chen

Context

Liked by @sarah_chen

Controlled

Liked by @sarah_chen and 3 others.

Liked by @sarah_chen and 3 others.

Root Provider

Open: false

Liked by @sarah_chen

API reference

This component mirrors the upstream Ark UI primitive. All props and DOM behavior are defined by Ark unless you see an ark-cn-only row below.

HoverCardPopup

PropTypeDescription
arrowClassName?stringClass on the arrow element.
arrowTipClassName?stringClass on the arrow tip.
disablePortal?booleanRenders content in-place instead of portaled.
positionerClassName?stringExtra class on the positioner wrapper.
showArrow?booleanToggles the arrow (default true).

See the ARK UI documentation for the full API.