Socket
Book a DemoInstallSign in
Socket

react-3d-hover

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-3d-hover

Wrap components to get a 3D hover

1.1.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

react-3d-hover

npm version npm bundle size

"A tiny package to hover smooth as butter for React"

Requirements

This package uses hooks internally so it has a requirement of React version 16.8 or above.

Installation

This package is hosted on npm

npm i react-3d-hover

Usage

This component is imported and used like any standard React component

import React from 'react';
import Hover from 'react-3d-hover';

const App = () => {
  return (
    <div class="App">
      <Hover></Hover>
    </div>
  );
};

export default App;

Props

Here is a list of available options with their defaults:

style:                  {}      // A jsx style object that will be applied to the root element
max:                    10      // Max tilt rotation (degrees)
perspective:            1000    // Transform perspective, the lower the more extreme the tilt gets.
scale:                  1       // 2 = 200%, 1.5 = 150%, etc..
speed:                  400     // Speed of the enter/exit transition
easing:                 "cubic-bezier(.03,.98,.52,.99)",    // Easing on enter/exit
onMouseEnter:           (e) => {} // A callback function for the mouse enter event 
onMouseMove:            (e) => {} // A callback function for the mouse move event 
onMouseLeave:           (e) => {} // A callback function for the mouse leave event 

Example:

<Hover scale={1.2} perspective={900} speed={500}>
  <div>Hello World</div>
</Hover>

License

MIT License

Keywords

react

FAQs

Package last updated on 24 May 2021

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.