usePage#

Import#

import { usePage } from 'bumbag';

Usage#

The usePage hook will give you meta data about the page, as well as sidebar & header utilities.

Is page collapsed? No
Is sidebar open? Yes
Is header open? Yes
Editable example

Schema#

const {
isCollapsed,
sidebar: {
isOpen,
isMinimized,
open,
close,
toggle,
minimize,
maximize,
toggleMinimize
},
header: {
isOpen,
open,
close,
toggle
}
} = usePage()

Return values#

isCollapsed boolean

Returns truthy if the page has collapsed to the collapse breakpoint (mobile view).

sidebar.isOpen boolean

Returns truthy if the sidebar is open.

sidebar.isMinimized boolean

Returns truthy if the sidebar is minimized.

sidebar.open function

Opens the sidebar

sidebar.close function

Closes the sidebar

sidebar.toggle function

Toggles the sidebar

sidebar.minimize function

Minimizes the sidebar

sidebar.maximize function

Maximizes the sidebar

sidebar.toggleMinimize function

Toggles if the sidebar is minimized or maximized

header.isOpen boolean

Returns truthy if the header is open.

header.open function

Opens the header

header.close function

Closes the header

header.toggle function

Toggles the header

Copyright © 2021 Jake Moxey