Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@radix-ui/react-hover-card

Package Overview
Dependencies
Maintainers
6
Versions
229
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-hover-card

  • 1.0.8-rc.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
651K
increased by1.86%
Maintainers
6
Weekly downloads
 
Created

What is @radix-ui/react-hover-card?

@radix-ui/react-hover-card is a React component library that provides a customizable hover card component. It allows developers to create interactive hover cards that display additional information when a user hovers over a target element. This can be useful for tooltips, previews, and other UI elements that require additional context on hover.

What are @radix-ui/react-hover-card's main functionalities?

Basic Hover Card

This example demonstrates a basic hover card setup where additional information is displayed when the user hovers over the trigger element.

```jsx
import { HoverCard, HoverCardTrigger, HoverCardContent } from '@radix-ui/react-hover-card';

function App() {
  return (
    <HoverCard>
      <HoverCardTrigger>Hover over me</HoverCardTrigger>
      <HoverCardContent>
        <div>Additional information displayed on hover</div>
      </HoverCardContent>
    </HoverCard>
  );
}

export default App;
```

Custom Styling

This example shows how to apply custom styles to the hover card components using CSS classes.

```jsx
import { HoverCard, HoverCardTrigger, HoverCardContent } from '@radix-ui/react-hover-card';
import './App.css'; // Assume custom styles are defined here

function App() {
  return (
    <HoverCard>
      <HoverCardTrigger className="custom-trigger">Hover over me</HoverCardTrigger>
      <HoverCardContent className="custom-content">
        <div>Styled additional information</div>
      </HoverCardContent>
    </HoverCard>
  );
}

export default App;
```

Delay Configuration

This example demonstrates how to configure the delay before the hover card opens and closes, providing a smoother user experience.

```jsx
import { HoverCard, HoverCardTrigger, HoverCardContent } from '@radix-ui/react-hover-card';

function App() {
  return (
    <HoverCard openDelay={300} closeDelay={200}>
      <HoverCardTrigger>Hover over me</HoverCardTrigger>
      <HoverCardContent>
        <div>Information with delay</div>
      </HoverCardContent>
    </HoverCard>
  );
}

export default App;
```

Other packages similar to @radix-ui/react-hover-card

FAQs

Package last updated on 12 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc