A simple react js onscroll sticky Nav bar library

Overview

stickyNav logo

react-js-stickynav

A simple react js nav bar onscroll

NPM JavaScript Style Guide

Intro

Install

npm install --save react-js-stickynav

Usage

length = navigation length , which is the length you want you want your sticky Nav to appear

import React from 'react'
import { StickyNav } from 'react-js-stickynav'
import 'react-js-stickynav/dist/index.css'

const App = () => {
  const style = () => {
    return (
      <style jsx>{`
        .nav {
          transition: all 0.1s linear;
          position: fixed;
          z-index: 2000;
          padding: 20px;
        }
        .scrollNav {
          transition: all 0.5s ease-in;
          z-index: 2000;
          background: #ffffff;
          width: 100%;
          border-bottom: 1px solid #dddddd;
        }
        .styl {
          padding-top: 80px;
        }
      `}</style>
    )
  }
  return (
    <div>
      {style()}
      <StickyNav length='40'>insert your Navbar Component here</StickyNav>
      <div className='styl'>
        <h1>
          Creating a Single-Page App in React using React Router by kirupa |
          filed under Learning React Now that you've familiarized yourself with
          the basics of how to work with React, let's kick things up a few
          notches. What we are going to do is use React to build a simple
          single-page app (also referred to as SPA by the cool kids...and people
          living in Scandinavia). Like we talked about in our React introduction
          forever ago, single-page apps are different from the more traditional
          multi-page apps that you see everywhere. The biggest difference is
          that navigating a single-page app doesn't involve going to an entirely
          new page. Instead, your pages (commonly known as views in this
          context) typically load inline within the same page itself: When you
          are loading content inline, things get a little challenging. The hard
          part is not loading the content itself. That is relatively easy. The
          hard part is making sure that single-page apps behave in a way that is
          consistent with what your users are used to. More specifically, when
          users navigate your app, they expect that: The URL displayed in the
          address bar always reflects the thing that they are viewing. They can
          use the browser's back and forward buttons...successfully. They can
          navigate to a particular view (aka deep link) directly using the
          appropriate URL. With multi-page apps, these three things come for
          free. There is nothing extra you have to do for any of it. With
          single-page apps, because you aren't navigating to an entirely new
          page, you have to do real work to deal with these three things that
          your users expect to just work. You need to ensure that navigating
          within your app adjusts the URL appropriately. You need to ensure your
          browser's history is properly synchronized with
        </h1>
        <h5>
          Creating a Single-Page App in React using React Router by kirupa |
          filed under Learning React Now that you've familiarized yourself with
          the basics of how to work with React, let's kick things up a few
          notches. What we are going to do is use React to build a simple
          single-page app (also referred to as SPA by the cool kids...and people
          living in Scandinavia). Like we talked about in our React introduction
          forever ago, single-page apps are different from the more traditional
          multi-page apps that you see everywhere. The biggest difference is
          that navigating a single-page app doesn't involve going to an entirely
          new page. Instead, your pages (commonly known as views in this
          context) typically load inline within the same page itself: When you
          are loading content inline, things get a little challenging. The hard
          part is not loading the content itself. That is relatively easy. The
          hard part is making sure that single-page apps behave in a way that is
          consistent with what your users are used to. More specifically, when
          users navigate your app, they expect that: The URL displayed in the
          address bar always reflects the thing that they are viewing. They can
          use the browser's back and forward buttons...successfully. They can
          navigate to a particular view (aka deep link) directly using the
          appropriate URL. With multi-page apps, these three things come for
          free. There is nothing extra you have to do for any of it. With
          single-page apps, because you aren't navigating to an entirely new
          page, you have to do real work to deal with these three things that
          your users expect to just work. You need to ensure that navigating
          within your app adjusts the URL appropriately. You need to ensure your
          browser's history is properly synchronized with
        </h5>
      </div>
    </div>
  )
}

export default App

License

MIT © abodmicheal

You might also like...

Soft UI Dashboard React - Free Dashboard using React and Material UI

Soft UI Dashboard React - Free Dashboard using React and Material UI

Soft UI Dashboard React Start your Development with an Innovative Admin Template for Material-UI and React. If you like the look & feel of the hottest

Dec 28, 2022

A web application to search all the different countries in the world and get details about them which can include languages, currencies, population, domain e.t.c This application is built with CSS, React, Redux-Toolkit and React-Router.

A web application to search all the different countries in the world and get details about them which can include languages, currencies, population, domain e.t.c This application is built with CSS, React, Redux-Toolkit and React-Router.

A web application to search all the different countries in the world and get details about them which can include languages, currencies, population, domain e.t.c This application is built with CSS, React, Redux-Toolkit and React-Router. It also includes a theme switcher from light to dark mode.

Jun 5, 2022

Finished code and notes from EFA bonus class on building a React project without create-react-app

React From Scratch Completed Code This is the completed code for the EFA bonus class on building a React project from scratch. Included are also markd

Oct 11, 2021

Free Open Source High Quality Dashboard based on Bootstrap 4 & React 16: http://dashboards.webkom.co/react/airframe

Free Open Source High Quality Dashboard based on Bootstrap 4 & React 16: http://dashboards.webkom.co/react/airframe

Airframe React High Quality Dashboard / Admin / Analytics template that works great on any smartphone, tablet or desktop. Available as Open Source as

Jun 5, 2022

React tooltip is a React.JS Component that brings usefull UX and UI information in selected elements of your website.

React Tooltip ✅ React tooltip is a React.JS Component that brings usefull UX and UI information in elements of your website. Installation ⌨️ React Too

Dec 22, 2021

React-tutorial - A React tutorial from Udemy (Academind)

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Mar 31, 2022

Airbnb-React - In this project, An Airbnb experience page clone is created to learn and implement React props concepts.

Airbnb-React - In this project, An Airbnb experience page clone is created to learn and implement React props concepts.

Create React Airbnb App In this project An airbnb experience page clone is created to learn and implement React props concepts. Objectives Learn about

Jun 28, 2022

Vtexio-react-apps - Apps react para plafaforma VTEX.

Vtexio-react-apps - Apps react para plafaforma VTEX.

Projeto Modal + Apps Extras Projeto modal setando cookies. Desenvolvido em React + TypeScript para aplicação em e-commerce VTEXIO. 🚨 Este projeto se

Jan 3, 2022

React-app - Building volume rendering web app with VTK.js,react & HTML Using datasets provided in vtk examples (head for surface rendering and chest for ray casting)

SBE306 Assignment 4 (VTK) data : Directory containing Head and Ankle datasets Description A 3D medical viewer built with vtk-js Team Team Name : team-

Jul 19, 2022
Owner
Abod Micheal
Front End /React Developer
Abod Micheal
Recoil is an experimental state management library for React apps. It provides several capabilities that are difficult to achieve with React alone, while being compatible with the newest features of React.

Recoil · Recoil is an experimental set of utilities for state management with React. Please see the website: https://recoiljs.org Installation The Rec

Facebook Experimental 18.2k Jan 8, 2023
React-Mini-Projects - Simple React mini-applications

React Mini Projects A Fully Responsive React Application contain these mini apps : Todo App Movie App Budget App Flash Card App Factor App This app wa

Morteza Rezaienia 1 Jan 1, 2022
Chrome-extension-react-boilerplate - Simple Chrome extension React boilerplate.

Simple Chrome extension React boilerplate This is a simple chrome extension boilerplate made in React to use as a default structure for your future pr

Younes 6 May 25, 2022
Simple React Social Network, built with React,Node,Express,MongoDB and Tailwind

Full stack react social network application A mini social network application built with React,Typescript, Redux, Node, Express, MongoDB, and Tailwind

Albenis Kërqeli 31 Dec 19, 2022
Material-UI is a simple and customizable component library to build faster, beautiful, and more accessible React applications. Follow your own design system, or start with Material Design.

Material-UI Quickly build beautiful React apps. Material-UI is a simple and customizable component library to build faster, beautiful, and more access

Material-UI 83.6k Dec 30, 2022
React Starter Kit — isomorphic web app boilerplate (Node.js, Express, GraphQL, React.js, Babel, PostCSS, Webpack, Browsersync)

React Starter Kit — "isomorphic" web app boilerplate React Starter Kit is an opinionated boilerplate for web development built on top of Node.js, Expr

Kriasoft 21.7k Dec 30, 2022
📋 React Hooks for forms validation (Web + React Native)

English | 繁中 | 简中 | 日本語 | 한국어 | Français | Italiano | Português | Español | Русский | Deutsch | Türkçe Features Built with performance and DX in mind

React Hook Form 32.4k Dec 29, 2022
:black_medium_small_square:React Move | Beautiful, data-driven animations for React

React-Move Beautiful, data-driven animations for React. Just 3.5kb (gzipped)! Documentation and Examples Features Animate HTML, SVG & React-Native Fin

Steve Hall 6.5k Jan 1, 2023
React features to enhance using Rollbar.js in React Applications

Rollbar React SDK React features to enhance using Rollbar.js in React Applications. This SDK provides a wrapper around the base Rollbar.js SDK in orde

Rollbar 39 Jan 3, 2023
🎉 toastify-react-native allows you to add notifications to your react-native app (ios, android) with ease. No more nonsense!

toastify-react-native ?? toastify-react-native allows you to add notifications to your react-native app (ios, android) with ease. No more nonsense! De

Zahid Ali 29 Oct 11, 2022