GithubHelp home page GithubHelp logo

react-top-nav's Introduction

react-top-nav

A configurable, top displayed navigation menu bar.

Setup

Copy the TopNav.js and TopNav.css to location of your choice. Modify the TopNav.css import path in TopNav.js if locating the TopNav.css in a different directory than TopNav.js.

Update menuConfig per your menu requirements. You can also remove the const menuConfig and import your menu from an external module.


Setup with AWS Amplify

If you are using AWS Amplify + Cognito for authentication and authorization, you can use the AmplifyTopNav.js in liue of the TopNav.js


Menu configuration

Each item must be of one of the following types:

type description
button trigger navigation when clicked
functionButton trigger a function/onClick when clicked - this is a basic button, and you provide the onClick function in your code
dropdown contain a dropdown menu with one or more items

button type should be in the following json format:

{
  name: 'name-goes-here',
  type: 'button',
  auth: [false|auth_object], // see below for details on auth_object
  link: { to: 'your_desired_path', text: 'link_text' }
}

functionButton type should be in the following json format:

 {
   name: 'name-goes-here',
   type: 'functionButton'
 }

dropdown type should be in the following json format:

 {
   name: 'name-which-appears-on-the-top-level-of-menu-goes-here',
   type: 'dropdown',
   auth: [false|auth_object], // see below for details on auth_object
   items: [
     { to: 'your_desired_path_1', text: 'link_text_1' }, // <-- each item represents a reach-router link
     { to: 'your_desired_path_2', text: 'link_text_2' }
   ]
 }

react-top-nav's People

Contributors

mojave27 avatar

Watchers

 avatar  avatar

react-top-nav's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.