TabMenu is a navigation/command component that displays items as tab headers.

import TabMenu from 'primevue/tabmenu';

Steps requires a collection of menuitems as its model. TabMenu can be also integrated with Vue Router.

<TabMenu :model="items" />
<router-view />

Visibility of the content is specified with the activeIndex property that supports one or two-way binding.

<Button @click="active = 0" text outlined label="Activate 1st" />
<TabMenu v-model:activeIndex="active" :model="items" />

Following is the list of structural style classes, for theming classes visit theming page.

p-tabmenuContainer element.
p-tabmenu-navList element.
p-tabmenuitemMenuitem element.
p-menuitem-linkLink element of the menuitem.
p-menuitem-iconIcon of a menuitem.
p-menuitem-textText of a menuitem.

Screen Reader

TabMenu component uses the menubar role and the value to describe the menu can either be provided with aria-labelledby or aria-label props. Each list item has a presentation role whereas anchor elements have a menuitem role with aria-label referring to the label of the item and aria-disabled defined if the item is disabled.

Keyboard Support

tabAdds focus to the active tab header when focus moves in to the component, if there is already a focused tab header moves the focus out of the component based on the page tab sequence.
enterActivates the focused tab header.
spaceActivates the focused tab header.
right arrowMoves focus to the next header.
left arrowMoves focus to the previous header.
homeMoves focus to the first header.
endMoves focus to the last header.