Client functions
useGuider()
#
This React hook is the way to hook into Guider internals. It can give you information about the entire Guider instance.
Example#
function useIsTocEnabled() {
const guider = useGuider();
const tocState = guider.settings.tocState;
return tocState;
}
Reference#
function useGuider(metaConf): GuiderContext;
metaConfMetaConf
Optional meta config overwrite, it will fall back on what is configured in _meta.json
files.
This does not account for FrontMatter config. Use useGuiderPage()
(Check here) if you need Frontmatter accounted for.
returnValueGuiderContext
The context for a Guider page.
siteSiteComponent
The currently active site.
directoryDirectoryComponent
The currently active directory.
layoutSiteLayoutComponent
The currently active layout.
settingsPopulatedLayoutSettings
The fully populated layout settings, all defaults are merged into it (so no optional properties).
Read more about layout settings.
metaMapMetaMapItem[]
A list of the contents of your _meta.json
files.
navContextobject
The navigational context of the page, use it to get the current links in the sidebar.