1.1.2 • Published 6 months ago

react-sticky-navbar v1.1.2

Weekly downloads
16
License
ISC
Repository
github
Last release
6 months ago

Sticky Navbar Demo

React Sticky Navbar

StickyNavbar is a React component that provides a customizable sticky navigation bar for websites. It allows for smooth scrolling and dynamic behavior based on the user's scroll position.

Demo

Installation

To install StickyNavbar, use npm or yarn:

npm install react-sticky-navbar
# or
yarn add react-sticky-navbar

Usage

import React from "react";
import StickyNavbar from "react-sticky-navbar";

const App = () => {
  return (
    <div>
      <StickyNavbar>
        {/* Navigation links or other content */}
      </StickyNavbar>
      {/* Your other components */}
    </div>
  );
};

export default App;

StickyNavbar takes various props to customize its behavior, including showOnTop, showOnScrollDown, showOnScrollUp, zIndex, duration, and stickyBackground. You can also pass classNames to customize the CSS classes for different scroll positions.

Props

  • children: React nodes to be rendered inside the sticky navbar.
  • classNames: Custom CSS class names for different scroll positions.
    • scrollTop: Custom CSS class name for the navbar when the user is at the top of the page.
    • scrollMiddle: Custom CSS class name for the navbar when the user is at the middle of the page.
    • scrollBottom: Custom CSS class name for the navbar when the user is at the bottom of the page.
    • scrollUp: Custom CSS class name for the navbar when the user scrolled up the page.
    • scrollDown: Custom CSS class name for the navbar when the user scrolled down the page.
  • showOnTop: Whether to show the navbar when the user is at the top of the page.
  • showOnBottom: Whether to show the navbar when the user is at the bottom of the page.
  • showOnScrollDown: Whether to show the navbar when the user is scrolling down.
  • showOnScrollUp: Whether to show the navbar when the user is scrolling up.
  • zIndex: The z-index of the navbar.
  • duration: Transition duration in milliseconds.
  • stickyBackground: Background color of the sticky navbar.

Contributing

Contributions are welcome! If you'd like to contribute to this project, feel free to fork the repository and submit a pull request with your changes.

Support

For support, please open an issue on the GitHub repository.

1.1.1

6 months ago

1.0.0

6 months ago

1.1.2

6 months ago

0.1.0

6 months ago

0.1.2

6 months ago

0.1.7

6 months ago

0.1.6

6 months ago

0.1.5

6 months ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago