Skip to main content

Function: useSidebar()

useSidebar(config?): UseSidebarReturn

Defined in: hooks/useSidebar/index.tsx:30

useSidebar

Parameters​

config?​

Configuration for the sidebar.

areaId?​

string

The ID of the DOM element to render the sidebar into.

Returns​

UseSidebarReturn

An object containing the Sidebar component and state management functions.

Description​

A custom hook to manage the state of a Sidebar component.

Example​

const { Sidebar, open } = useSidebar();
<Button onClick={open}>Open Sidebar</Button>
<Sidebar>Content</Sidebar>