NavigationMenu

Reference

Gympass <NavigationMenu /> displays a navigation menu with 3 optional main areas <NavigationMenu.Header />, <NavigationMenu.Items /> and <NavigationMenu.Footer />.

<NavigationMenu.Header /> and <NavigationMenu.Footer /> are containers that can be used to display components like logos, <NavigationMenu.Menu /> or <NavigationMenu.Switcher />.

<NavigationMenu.Items /> must be used to display items and subitems.

The menu is responsive by default and controled by props. <NavigationMenu.BottomItems /> and <NavigationMenu.BottomItem /> must be used to display the items in the bottom bar.

Available components:

  • <NavigationMenu.Header />
  • <NavigationMenu.Items />
  • <NavigationMenu.Footer />
  • <NavigationMenu.ItemsGroup />
  • <NavigationMenu.Item />
  • <NavigationMenu.Subitem />
  • <NavigationMenu.BottomItems />
  • <NavigationMenu.BottomItem />
  • <NavigationMenu.Menu />
  • <NavigationMenu.Switcher />

Usage

Not responsive navigation menu

import { flex } from '@gympass/yoga-system';
import { theme, Icon, Container, NavigationMenu, Avatar, Box } from '@gympass/yoga';
import { Doc, Help } from '@gympass/yoga-icons';

Responsive navigation menu

import { Doc, Help, MenuMore } from '@gympass/yoga-icons';
import { media } from '@gympass/yoga-helpers';
import { theme, Icon, Container, NavigationMenu, Avatar, Box } from '@gympass/yoga';
import { flex } from '@gympass/yoga-system';
import { theme, NavigationMenu, Text, Avatar } from '@gympass/yoga';

Switcher subcomponent with actions

import { theme, NavigationMenu, Avatar } from '@gympass/yoga';

Props

PropDescriptionTypeDefaultRequired
childrenMenu sub componentsnodetrue
openOnMobileIndicates whether the menu is open/close in mobileboolfalsefalse
responsiveIndicates whether the menu should be responsivebooltruefalse
zIndexValue of z-index of the menunumber2false
PropDescriptionTypeDefaultRequired
avatarElement displayed on the left (Avatar, Icon, ...)nodetrue
subtitleText to be displayed as subtitlestringfalse
titleText to be displayed as titlestringfalse
onClickEvent triggered when clicking on the componentfuncfalse
iconCustom action iconnodefalse
PropDescriptionTypeDefaultRequired
idAction idstringtrue
labelAction labelstringtrue
onClickEvent triggered when clicking on the actionfunctrue
zIndexValue of z-index of the switcher actions menunumber1false
PropDescriptionTypeDefaultRequired
actionsSwitcher actionsobjfalse
avatarElement displayed on the left (Avatar, Icon, ...)nodetrue
fillColor used as backgroundstringtransparentfalse
isLoadingIndicates whether the title and the subtitle are loadingboolfalsefalse
sideOffsetHorizontal space between the action icon and the liststring4false
subtitleText to be displayed as subtitlestringfalse
titleText to be displayed as titlestringfalse
PropDescriptionTypeDefaultRequired
activeIndicates whether the item is active/inactive. This prop is not necessary when the wrapper already handles this.boolfalsefalse
childrenSubitems to be displayed under the itemnodefalse
expandedControls when to hide/show subitemsboolfalsefalse
iconItem's iconnodefalse
labelItem's namestringtrue
responsiveIndicates whether the item should be responsivebooltruefalse
tagTag textstringfalse
wrapperLink that wraps the itemnodetrue
PropDescriptionTypeDefaultRequired
activeIndicates whether the item is active/inactive. This prop is not necessary when the wrapper already handles this.boolfalsefalse
labelItem's namestringtrue
wrapperLink that wraps the subitemnodetrue
PropDescriptionTypeDefaultRequired
childrenItems to be displayed in the mobile bottom barnodetrue
zIndexValue of z-index of the bottom items menunumber2false
PropDescriptionTypeDefaultRequired
activeIndicates whether the item is active/inactive. This prop is not necessary when the wrapper already handles this.boolfalsefalse
iconItem's iconnodefalse
labelItem's namestringtrue
wrapperLink that wraps the itemnodetrue
Made with ❤️ by Gympass • github