A customizable React hamburger menu component with sidebar
npm install react-hamburger-menu-componentA lightweight, customizable React hamburger menu component with sidebar functionality.
``bash`
npm install react-hamburger-menu-component
`jsx
import HamburgerMenu from 'react-hamburger-menu-component';
import 'react-hamburger-menu-component/dist/index.css';
function App() {
return (
onToggle={(isOpen) => console.log('Menu is', isOpen ? 'open' : 'closed')}
>
Home
About
Contact
);
}
`
- children: React nodes to display in the sidebargreeting
- : Text/component to display next to the hamburger buttononToggle
- : Callback function called when menu opens/closesclassName
- : Additional CSS class for the wrapperhamburgerClassName
- : Additional CSS class for the hamburger buttonsidebarClassName
- : Additional CSS class for the sidebarposition`: 'left' or 'right' (default: 'left')
-