The Category Menu is a store component that displays a list of departments in a configurable menu layout. It helps organize and present categories and subcategories to improve navigation.
An error occurred while trying to load the image. https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/docs/vtex-menu-0.png
Configuration
Add the app to your store theme's dependencies in the manifest.json.
dependencies: {
"vtex.category-menu" : "2.x"
}
Add the category-menu block to your store theme.
{
"category-menu" : {
"props" : {
"showAllDepartments" : true ,
"showSubcategories" : true ,
"menuDisposition" : "center" ,
"departments" : [ ] ,
"sortSubcategories" : "name"
}
}
}
Prop name Type Description Default Value showAllDepartmentsBooleanShows all department categories in the menu truemenuDispositionEnumIndicates the menu's position on the screen. Possible values: left, center, right centershowSubcategoriesBooleanDefines if the subcategories will be displayed truedepartmentsArray(items)List of department items to be displayed on the menu []mobileModeBooleanRenders the category menu in a sidebar if set to true falsesortSubcategoriesEnumDetermines how subcategories are sorted. Possible value: name
Prop name Type Description idNumberThe department ID to be displayed on the menu
Customization
In order to apply CSS customizations in this and other blocks, follow the instructions on Using CSS Handles for store customization .
CSS Handles containerdepartmentLinkdepartmentListfirstLevelLinkfirstLevelLinkContainerfirstLevelListitemContaineritemContainer--categoryitemContainer--departmentmenuContainersecondLevelLinksecondLevelLinkContainersecondLevelListsection--categorysection--departmentsidebarsidebarContainersidebarContentsidebarHeadersidebarItemsidebarItemContainersidebarOpensidebarScrimsubmenuItemsubmenuList