Skip to content

Navigation - Web Component โ€‹

The Navigation component can be used imported from:

Playground โ€‹

Parameters โ€‹

The Web component uses the <z-navigation> tag:

By default, all the parameters are optional or can be set in different, except for the ones marked as required

The parametrization of the component can be done with the following custom HTML params:

NameTypeDescriptionSlotA11y
menustring[]The options for the menu
routesstring[]The links found in the navigation bar.

Events โ€‹

This component has events. Check the documentation about how to use the events.

NamePayloadDescription

Slots โ€‹

This component has slots. Check the documentation about how to use the slots.

NameTagsDescription
defaultspanThe content of the navigation bar.

Parameters use โ€‹

The attribute menu is an array of objects that represent the menu items. Each object has the following properties:

  • text: The text to be displayed for the list item.
  • href: The URL to navigate to when the list item is clicked.
  • items: An array of objects that represent the sub-menu items. Each object has the same properties as the parent object.

The menu it's separated in columns, make sure if you want to display different list options in the same column you use the same array.

routes โ€‹

The attribute routes is an array of objects that represent the navigation links. Each object has the following properties:

  • text: The text to be displayed for the list item.
  • href: The URL to navigate to when the list item is clicked.
  • icon: The icon to be displayed for the list item.

Browser support โ€‹

Detected engine: ย 

  • Chromium

  • Webkit

  • Gecko

HTML Examples โ€‹

CodeSandbox example โ€‹