New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-hover-graphic

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hover-graphic

A React component to effortlessly display a graphic on hover

latest
Source
npmnpm
Version
0.0.5
Version published
Maintainers
0
Created
Source

🔥 Display an On-Hover Graphic Following Your Cursor 🔥

demo
Live Demo Source

One Simple Way to Use 📚

import React from "react";
import HoverGraphic from "react-hover-graphic";

export const ExampleComponent: React.FC = () => {
  return (
    <HoverGraphic
      src="https://matthewtrent.me/cat_shock.gif" // graphic source (local or remote)
      height="100px" // graphic height; default: "auto"
      width="200px" // graphic width; default: "auto"
      objectFit="contain" // graphic object-fit ("cover" | "contain" | "fill" | "none" | "scale-down"); default: "cover"
      offsetTop={0} // graphic offset top; default: 0
      offsetLeft={0} // graphic offset left; default: 0
      offsetRight={0} // graphic offset right; default: 0
      offsetBottom={60} // graphic offset bottom; default: 0
      zIndex={9999} // graphic z-index; default: 9999
      disabled={false} // disable effect; default: false
      disabledOnMobile={false} // disable effect on mobile; default: true
    >
      // any children, here's an example link
      <a href="https://matthewtrent.me">hello world</a>
    </HoverGraphic>
  );
};

Installing 🧑‍🏫

Available on npmjs. Installable via:

npm install react-hover-graphic

or

yarn add react-hover-graphic

Additional Info 📣

  • The package is always open to improvements, suggestions, and additions!

  • I'll look through PRs and Issues as soon as I can!

  • This package was mainly created just to test out publishing a package to npmjs. Also, because I like using this effect on websites I make and wanted an easier way to implement it.

Keywords

react

FAQs

Package last updated on 02 Jan 2025

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