1.1.0 • Published 1 year ago

parallax-container v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

React Parallax Container

A React component container that can makes a graphic card with a parallax effect

Published on npm

Features

  • TypeScript friendly
  • Supports parallax max depth configuration
  • Parallax effect of cards of different sizes has strong consistency

Installation

npm install parallax-container

Example

Open in StackBlitz

Usage

import { ParallaxContainer } from 'parallax-container';

function App() {
  return (
    <ParallaxContainer>
      <img src="https://picsum.photos/seed/picsum/400/250" alt="" width={400} height={250} />
      <p>a text title or description </p>
    </ParallaxContainer>
  );
}

export default App;

Configs

interface Props {
  children: React.ReactNode; // slot
  maxDepth?: number; // Supports parallax depth configuration
  className?: string;
  style?: React.CSSProperties;
}