react-hamburger-icon
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

React Hamburger Icon

NPM License

A featherweight animated 'hamburger' menu icon for React. Highly configurable and stylable, with sensible defaults.

Installation

npm i react-hamburger-icon

Usage

Import the component and use it anywhere you want a hamburger icon. Pass an open prop to determine whether it shows an open state. You can configure it with animation, lineWidth, and duoLine props, as well as style things like size and color directly on the component.

See the API Docs for a full overview of props and options.

import React, { useState } from 'react';
import { HamburgerIcon } from 'react-hamburger-icon';
 
export function Menu() {
  const [open, setOpen] = useState(false);
 
  return <HamburgerIcon open={open} onClick={() => setOpen(!open)} />;
}

Package Sidebar

Install

npm i react-hamburger-icon

Weekly Downloads

142

Version

1.0.2

License

MIT

Unpacked Size

141 kB

Total Files

9

Last publish

Collaborators

  • seaneking