Skip to content
Shopware

useNavigation

useNavigation

Composable for navigation. Provides state for navigation trees depending on navigation type.

Types

ts
export function useNavigation(params?: {
  type?: Schemas["NavigationType"] | string;
}): UseNavigationReturn

source code

ts
export type UseNavigationReturn = {
  /**
   * List of navigation elements
   */
  navigationElements: ComputedRef<Schemas["NavigationRouteResponse"] | null>;
  /**
   * Load navigation elements
   */
  loadNavigationElements(
    params: operations["readNavigation post /navigation/{activeId}/{rootId}"]["body"],
  ): Promise<Schemas["NavigationRouteResponse"]>;
};

source code