Skip to content

Tab

Organizes content into separate views that users can switch between.

First release: 1.0.0 Latest update: July 1, 2025 Current version: 1.0.0

React Angular Vue Svelte HTML

Import

import { PlusTab } from '@plusui/react';
import { PlusTabComponent } from '@plusui/angular';
import { PlusTab } from '@plusui/vue';
import PlusTab from '@plusui/svelte';
<script src="https://cdn.jsdelivr.net/npm/@plusui/core"></script>

Package

@plusui/react
@plusui/angular
@plusui/vue
@plusui/svelte
@plusui/core

Docs

Changelog

Tab Changelog

Recent changes and updates for the tab component

v1.0.0

June 20, 2025
Feat

Added Tab component for navigation

  • Horizontal and vertical orientations
  • Prefix and suffix icons
  • Dismissible tabs
  • Animated indicators
  • Accessibility with ARIA attributes

The Tab component system (plus-tab-group, plus-tab, plus-tab-panel) allows organizing content into selectable sections. The plus-tab-group manages the interaction between plus-tab elements (which act as controllers) and their corresponding plus-tab-panel elements (which contain the content).

Tab Component - anatomy

Structure your tabs by placing plus-tab elements in the tablist slot and plus-tab-panel elements in the panels slot of the plus-tab-group. Ensure each plus-tab has a unique value attribute matching the value attribute of its corresponding plus-tab-panel.

Tab 1Tab 2Tab 3Content for Tab 1Content for Tab 2Content for Tab 3
Show code
Show console

Adjust the size of the tabs using the size prop on plus-tab-group.

Small 1Small 2Small Content 1Small Content 2Medium 1Medium 2Medium Content 1Medium Content 2Large 1Large 2Large Content 1Large Content 2
Show code

Use the alignment prop on plus-tab-group to position the tabs (start, center, end).

Start 1Start 2PanelPanelCenter 1Center 2PanelPanelEnd 1End 2PanelPanel
Show code

Set the orientation prop to vertical on plus-tab-group to arrange tabs vertically.

Vertical 1Vertical 2Vertical 3Content 1Content 2Content 3
Show code

Add the animated attribute to plus-tab-group for a sliding indicator effect. Works for both horizontal and vertical orientations.

Animated Tab 1Animated Tab 2Content 1Content 2Vertical Animated 1Vertical Animated 2Content 1Content 2
Show code

Add the dismissible attribute to plus-tab-group to allow closing tabs. You need to handle the plus-tab-dismiss event to remove the tab and its corresponding panel.

Dismissible 1Dismissible 2Dismissible 3Content 1Content 2Content 3
Show code
Show console

Add the disabled attribute to a plus-tab to prevent its selection.

EnabledDisabledAnother EnabledContent 1Content 2 (won’t be shown via click)Content 3
Show code

Use the prefix-icon or suffix-icon attributes on plus-tab, or place icons directly in the default slot.

HomeCartInfo

Contact (Slot)

Home ContentCart ContentInfo ContentContact Content
Show code
Tab Component - layout spacing Tab Component - light & dark mode
  • Keyboard Behavior:
    • When focus is on a plus-tab:
      • ArrowLeft/ArrowUp: Moves focus to the previous tab. Wraps around.
      • ArrowRight/ArrowDown: Moves focus to the next tab. Wraps around.
      • Home: Moves focus to the first tab.
      • End: Moves focus to the last tab.
      • Enter or Space: Activates the focused tab, displaying its associated panel.
  • Screen Reader:
    • plus-tab-group uses role="tablist".
    • Each plus-tab uses role="tab", with aria-selected indicating the active state and aria-controls pointing to the ID of its associated plus-tab-panel.
    • Disabled tabs have aria-disabled="true".
    • Each plus-tab-panel uses role="tabpanel", with aria-labelledby pointing to the ID of its controlling plus-tab.
  • Required Developer Actions:
    • Ensure plus-tab elements have meaningful text content or accessible labels (aria-label).
    • Link tabs and panels correctly using the value attribute on both plus-tab and plus-tab-panel.
    • Assign unique IDs to plus-tab and plus-tab-panel if default ID generation needs overriding for aria-controls and aria-labelledby.
NameTypeDefaultDescriptionRequired
size'sm' | 'md' | 'lg''md'Size of the tabs within the group.No
orientation'horizontal' | 'vertical''horizontal'Displays tabs vertically or horizontally.No
alignment'start' | 'center' | 'end''start'Horizontal alignment of the tabs within the tab list.No
noScrollbooleanfalseDisables the scroll buttons when tabs overflow the container width.No
animatedbooleanfalseEnables the animated (sliding) indicator.No
dismissiblebooleanfalseAllows tabs to be closed via a dismiss button. Requires event handling.No
NamePayload TypeDescription
plus-tabs-changeCustomEvent<{ value: string }>Fired when a tab panel is activated. event.detail.value is the panel’s value.
plus-tab-dismissCustomEvent<{ value: string }>Fired when a dismissible tab is closed. event.detail.value is the tab’s value.
NameDescription
tablistContains the plus-tab elements for navigation.
panelsContains the plus-tab-panel elements for content.
NameParametersReturnsDescription
show(panel)panel: stringPromise<void>Programmatically shows the specified tab panel.
NameDescription
baseThe main container element.
navThe container for the navigation tabs (role="tablist").
tabsThe scrollable container for the tabs.
active-tab-indicatorThe indicator showing the active tab.
bodyThe container for the tab panels.
scroll-buttonThe scroll buttons (visible when tabs overflow).
scroll-button--startThe scroll button at the start.
scroll-button--endThe scroll button at the end.
scroll-button__baseThe base element of a scroll button.
NameDescription
--plus-tab-indicator-colorColor of the active tab indicator. Default is primary.
--plus-tab-indicator-sizeThickness of the active tab indicator. Default is 2px.
--plus-tab-track-colorColor of the track beneath the tabs. Default is neutral-base.
--plus-tab-track-sizeThickness of the track beneath the tabs. Default is 2px.
--plus-tab-track-gapSpace between the track and the tabs. Default is 0px.
--plus-tab-transition-speedSpeed of the indicator transition. Default is 200ms.

NameTypeDefaultDescriptionRequired
valuestring''Unique value identifying the tab and linking it to a plus-tab-panel.Yes
activebooleanfalseIndicates if the tab is currently active. Managed by the parent plus-tab-group.No
disabledbooleanfalseDisables the tab, preventing selection.No
prefix-iconstringundefinedClass name(s) for an icon to display before the tab text.No
suffix-iconstringundefinedClass name(s) for an icon to display after the tab text.No
NamePayload TypeDescription
plus-tab-dismissCustomEvent<{ value: string }>Fired from parent when this tab is dismissed (if dismissible).
NameDescription
(default)The content of the tab (text, icons, etc.).
NameDescription
baseThe main tab button element.
dismiss-buttonThe dismiss button (if group is dismissible).
NameDescription
--plus-tab-color-defaultDefault text color.
--plus-tab-color-default-hoverText color on hover.
--plus-tab-color-default-activeText color when active.
--plus-tab-color-disabledText color when disabled.
--plus-tab-bg-default-hoverBackground color on hover.
--plus-tab-bg-default-activeBackground color when active.
--plus-tab-focus-ring-colorColor of the focus ring.
--plus-tab-focus-ring-widthWidth of the focus ring.
--plus-tab-focus-ring-offsetOffset of the focus ring.

NameTypeDefaultDescriptionRequired
valuestring''Unique value matching the value attribute of its controlling plus-tab.Yes
activebooleanfalseIndicates if the panel is currently active. Managed by the parent plus-tab-group.No
NameDescription
(default)The content of the tab panel.
NameDescription
baseThe main panel container element.

Join the Community

Plus UI is built by the community. Join us on our platforms to contribute, get help, and stay up to date.