GithubHelp home page GithubHelp logo

lineldcosta / react-responsive-menu-hook Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 600 KB

Simple flexible hook to convert any menu links into responsive links.

License: MIT License

JavaScript 100.00%
menu responisive-menu react-responsive-menu react-responsive-menu-hook

react-responsive-menu-hook's Introduction

react-responsive-menu-hook

Features

  • Headless
  • Responsive
  • Extensible

Installation

yarn add react-responsive-menu-hook
# or
npm i -s react-responsive-menu-hook

Basic Usage

import React from 'react'
import ReactResponsiveMenu from 'react-responsive-menu-hook'

function App() {
  return (
    <ReactResponsiveMenu>
      {({ getMenuProps, showEllipsis, children, open, toggle }) => {
        return (
          <React.Fragment>
            <div {...getMenuProps({ id: 'home', style })}>Home</div>
            <div {...getMenuProps({ id: 'contactUs', style })}>Contact Us</div>
            <div {...getMenuProps({ id: 'aboutUs', style })}>About Us</div>
            <div {...getMenuProps({ id: 'registration', style })}>Registration</div>
            <div {...getMenuProps({ id: 'login', style })}>Login</div>
            <div {...getMenuProps({ id: 'helpSupport', style })}>Help & Support</div>
            <div {...getMenuProps({ id: 'Blogs', style })}>Blogs</div>
            <div {...getMenuProps({ id: 'information', style })}>Information</div>
            <div {...getMenuProps({ id: 'apply', style })}>Apply</div>
            <div {...getMenuProps({ id: 'cancel', style })}>Cancel</div>

            {showEllipsis && (
              <div style={styles.overflowMenuWrapper}>
                <div
                  style={styles.overflowMenuIcon}
                  onClick={() => toggle(true)}
                >
                  ...
                </div>
                <div id="long-menu" style={styles.overflowMenu(open)}>
                  {children}
                </div>
              </div>
            )}
          </React.Fragment>
        )
      }}
    </ReactResponsiveMenu>
  )
}
export default App

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.