Skip to content
CtrlK

findCurrentSidebarItem

On this page

Find the current sidebar item based on the current path. This is client-safe and does not use any Node.js modules.

import { findCurrentSidebarItem } from "ardo/runtime"

findCurrentSidebarItem(sidebar: SidebarItem[], currentPath: string): SidebarItem | undefined

Parameters

NameTypeRequired
sidebarSidebarItem[]Yes
currentPathstringYes

Returns

SidebarItem | undefined