Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aiherrera/react-hamburger

A simple & easy to use react hamburger
https://github.com/aiherrera/react-hamburger

aih-public-showcase hamburger hamburger-menu react react-component

Last synced: about 13 hours ago
JSON representation

A simple & easy to use react hamburger

Awesome Lists containing this project

README

        

# 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](https://coderlab.aiherrera.com/?path=/story/playground-react-components--hamburger)

## Usage

`{ Hamburger }`

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

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

```

### Full example

```TSX
import React from 'react'

import Hamburger from '@aiherrera/react-hamburger'

const App = () => {

const [state, setState] = useState(false)

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

return (
<>

>
)
}
```

## Props

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

| Name | Type | Unit | Description | Default |
| --------- | ------ | --------- | ------------------------------------------------ | -------- |
| color | string | N/A | Color of the
hamburger bars | #28282A |
| size | string | N/A | Size of the hamburger | 'medium' |
| direction | string | N/A | Where is located | 'right' |
| device | string | N/A | In which devices is displayed
the component | 'all' |
| top | string | px/em/rem | Distance from the top | '10px' |
| left | string | px/em/rem | Distance from the left | 'auto' |
| right | string | px/em/rem | Distance from the right | 'auto' |