https://codesandbox.io/s/nameless-worker-z31nt
Added the tilt effect to cards by react-parallax-tilt
mkosir
/
react-parallax-tilt
๐ Easily apply tilt hover effect to React components - lightweight/zero dependencies 3kB
React Tilt
๐ Easily apply tilt hover effects to React components
Install
npm install react-parallax-tilt
Features
- Lightweight 3kB, zero dependencies ๐ฆ
- Tree-shakable ๐ณ ESM and CommonJS support
- Works with React v15 onwards
- Supports mouse and touch events
- Support for device tilting (gyroscope)
- Glare effect ๐ with custom props (color, position, etc.) ๐demo
- Event tracking for component values ๐ (tilt, glare, mousemove, etc.) ๐demo
- Multiple built-in effects:
Example
import Tilt from 'react-parallax-tilt';
const App = () => {
return (
<Tilt>
<div style={{ height: '300px', backgroundColor: 'darkgreen' }}>
<h1>React Parallax Tilt ๐</h1>
</div>
โฆ
https://codesandbox.io/embed/nameless-worker-z31nt?fontsize=14&hidenavigation=1&theme=dark
Top comments (0)