Components组件Base UIBase UI 组件
Hover Card
For sighted users to preview content available behind a link.
Partially translated: Chinese navigation, titles, descriptions, and common headings. The technical body is currently in English.
Loading JGuang UI example…
Installation
Command
Manual
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
Install the following dependencies:
npm install @base-ui/react
Copy and paste the following code into your project.
View complete source: components/ui/hover-card.tsx
Update the import paths to match your project setup.
Usage
import {
HoverCard,
HoverCardContent,
HoverCardTrigger,
} from "@/components/ui/hover-card"
<HoverCard>
<HoverCardTrigger>Hover</HoverCardTrigger>
<HoverCardContent>
The React Framework – created and maintained by @vercel.
</HoverCardContent>
</HoverCard>
Composition
Use the following composition to build a HoverCard:
HoverCard
├── HoverCardTrigger
└── HoverCardContent
Trigger Delays
Use delay and closeDelay on the trigger to control when the card opens and
closes.
<HoverCard>
<HoverCardTrigger delay={100} closeDelay={200}>
Hover
</HoverCardTrigger>
<HoverCardContent>Content</HoverCardContent>
</HoverCard>
Positioning
Use the side and align props on HoverCardContent to control placement.
<HoverCard>
<HoverCardTrigger>Hover</HoverCardTrigger>
<HoverCardContent side="top" align="start">
Content
</HoverCardContent>
</HoverCard>
Basic
Loading JGuang UI example…
Sides
Loading JGuang UI example…
RTL
To enable RTL support in JGuang UI, see the RTL configuration guide.
Loading JGuang UI example…
API Reference
See the Base UI documentation for more information.
Source: components/base/hover-card.mdx
Technical documentation for JGuang UI.