Simple lightweight react hamburger navigation drawer.
npm install react-hamburger-drawer   
Simple lightweight react hamburger navigation drawer (based on navigation-drawer).
- Hidden as a toggle;
- Fullscreen element for veil;
- Google Material spec for sizes, animations, and colors.
- Support keyboard navigation (Tab, Esc and Enter);
- Prevents page scrolling when the navigation drawer is open.
``bash`
npm install react-hamburger-drawerOr
yarn add react-hamburger-drawer
`js`
import HamburgerDrawer from "react-hamburger-drawer";
`html`
- useFocusBounder - An optional property to enable or disable FocusBounder component. Default false.
> All components inside the app directory are React Server Components by default.
> To use useRef or useEffect hooks, the component must be marked as client component: "use client".
Create a "drawer.js" file with the following content:
`js`
"use client";
import HamburgerDrawer from "react-hamburger-drawer";
export default HamburgerDrawer;
And import the HamburgerDrawer component from the "drawer.js" module:
`js``
import HamburgerDrawer from "./drawer";
Links:
- https://nextjs.org/docs/messages/react-client-hook-in-server-component
- https://nextjs.org/docs/app/building-your-application/rendering
- https://react.dev/reference/react/use-client
![]() | ![]() |