1.0.1 • Published 9 months ago

@galangel/react-scroll-magic v1.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 months ago

Scroll Component

Live Demo

Overview

The Scroll Magic Component is a React component that provides smooth scrolling functionality for your web application. It allows you to create scroll between items and headers and keep the headers visible.

Features

  • sticky headers in both directions
  • scroll to header by click
  • typescript

Installation

To install the Scroll Component, use npm or yarn:

npm i @galangel/react-scroll-magic

or

yarn add @galangel/react-scroll-magic

Usage

Here is a basic example of how to use the Scroll Component in your React application:

import React from 'react';
import { ScrollComponent } from '@galangel/react-scroll-magic';

const App = () => {
  return (
    <Scroll
      items={
        [
          /* array of items */
        ]
      }
      {...props}
    />
  );
};

export default App;

Props

The Scroll Component accepts the following props:

PropTypeDescription
stickTotop|bottom|allhow headers should stick
scrollBehaviorscrollBehavior CSS propertyhow the scrolling should behave when clicking a header
headerBehaviorstick|push|nonehow the headers behave when scrolling
itemsitems arraynested structure of items
loadingLoadingobject containing loading state and optional callbacks
loading.onBottomReached() => Promise<void>Optional callback function triggered when the bottom is reached
loading.render(isLoading: boolean) => JSX.ElementOptional render function for custom loading indicator

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please read the CONTRIBUTING guidelines before submitting a pull request.

Contact

For any questions or feedback, please open an issue on GitHub.

1.0.1

9 months ago

1.0.0

9 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago