1.0.12 • Published 1 year ago

@aiherrera/react-hamburger v1.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Hamburger Menu Button for React

A simple & easy to use react Hamburger menu.

Installation

Requires React 16 or later

npm i --save @aiherrera/react-hamburger

# or

yarn add @aiherrera/react-hamburger

Demo

You can check all the configurations in Ai-CoderLab

Usage

{ Hamburger }

// ES5 syntax
const Hamburger = require('@aiherrera/react-hamburger')

// ES6 syntax
import Hamburger from '@aiherrera/react-hamburger'

Full example

import React from 'react'

import Hamburger from '@aiherrera/react-hamburger'

const App = () => {

  const [state, setState] = useState(false)

  const handleClick = () => {
    setState(!state)
  }

  return (
    <>
      <Hamburger
        handleClick={handleClick}
        isOpened={state}
      />
    </>
  )
}

Props

All these props are passed as defaults and can be overriden any time.

NameTypeUnitDescriptionDefault
colorstringN/AColor of the hamburger bars#28282A
sizestringN/ASize of the hamburger'medium'
directionstringN/AWhere is located'right'
devicestringN/AIn which devices is displayed the component'all'
topstringpx/em/remDistance from the top'10px'
leftstringpx/em/remDistance from the left'auto'
rightstringpx/em/remDistance from the right'auto'
1.0.11

1 year ago

1.0.10

1 year ago

1.0.12

1 year ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago