useSidebar
Last updated
Last updated
The useSidebar hook is used inside the component. This hook handles the sidebar logic, inside the navbar component shown on mobile devices.
This hook is an internal hook and is not available for the users since it's not exposed as a part of this library.
It accepts a single parameter, initialValue
, a boolean value (default false).
It returns the following:
sidebarStatus
- the current state of the sidebar,
openSidebar
- a function for opening the sidebar and
closeSideBar
- a function for closing the sidebar.
As you can see above it uses the hook of the React internally for handling the sidebar shown on mobile devices.