use-3d-effect
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

use-3d-effect

NPM JavaScript Style Guide

demo

Install

npm install --save use-3d-effect

Usage

import * as React from 'react'
import { animated } from 'react-spring';
import { use3dEffect } from 'use-3d-effect';
 
const Example = () => {
  const ref = React.useRef(null);
  const {style, ...mouseHandlers} = use3dEffect(ref);
 
  return (
    <animated.div
      ref={ref}
      style={{
        background: '#61dafb', color: 'white', padding: '2em',
        ...style
      }}
      {...mouseHandlers}
    >
      Hover over me!
    </animated.div>
  );
};

License

MIT © Hermanya


This hook is created using create-react-hook.

Readme

Keywords

none

Package Sidebar

Install

npm i use-3d-effect

Weekly Downloads

16

Version

1.1.0

License

MIT

Unpacked Size

184 kB

Total Files

8

Last publish

Collaborators

  • hermanya