parallax-container
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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;
}

Package Sidebar

Install

npm i parallax-container

Weekly Downloads

3

Version

1.1.0

License

MIT

Unpacked Size

217 kB

Total Files

6

Last publish

Collaborators

  • okokdi