Components组件Radix UIRadix 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 radix-ui
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 openDelay and closeDelay on the HoverCard to control when the card opens and
closes.
<HoverCard openDelay={100} closeDelay={200}>
<HoverCardTrigger>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 Radix UI documentation for more information.
Source: components/radix/hover-card.mdx
Technical documentation for JGuang UI.