Skip to main content
BEEQ Tab component overview
Tabs let users navigate between related sections of content within the same page or view. Each tab reveals one panel at a time, keeping the interface clean while making multiple content sections available without navigation.
bq-tab must always be placed inside a bq-tab-group. The group manages tab state, keyboard navigation, and propagates size, orientation, and placement to all child tabs automatically.

When to use

Use tabs when
  • Content can be clearly organized into a small number of distinct, peer-level sections
  • Users need to compare or switch between sections without losing page context
  • Space is limited and displaying all sections at once would clutter the layout
  • Each section can stand independently without requiring the user to read others first

Do not use tabs when
  • The number of tabs exceeds seven — prefer a sidebar navigation or dropdown instead
  • Content across sections is sequential and users must read them in order — prefer a stepper
  • Sections contain very different content types that do not relate to the same subject
  • The goal is to navigate to a new page or route — prefer anchor links or a navigation component

Anatomy

BEEQ Tab component anatomy
The tab group renders a list of tab buttons inside a scrollable container. Each individual tab consists of an optional icon, a text label, and an active-state underline indicator.
PartElementDescription
1Active tabThe currently selected tab button, visually distinguished by brand color and the selected indicator
2Inactive tabA tab button that is not currently selected; clicking it activates it and deactivates the previous tab
3Selected indicatorThe underline beneath the active tab that marks the current selection; exposed as the underline shadow part
4Text labelThe visible label inside each tab button; placed in the default slot and exposed as the text shadow part

Design guidelines

Orientation

Size

1

small

Compact tabs with reduced padding. Use in dense interfaces or data-heavy views where space is constrained.
2

medium

The default size. Appropriate for most applications and standard-density layouts.
3

large

Prominent tabs with increased padding. Use when tabs are a primary navigation element or accessibility requires larger touch targets.
Setting size on bq-tab-group propagates the value to all child bq-tab elements automatically. You do not need to set size on each tab individually.

Placement

Use placement="start" (default) to left-align horizontal tabs or top-align vertical tabs. Use placement="end" to right-align horizontal tabs or bottom-align vertical tabs.

Usage

Default

Options

With icons

Tabs support an optional icon displayed before the label via the icon slot.

Sizes

Vertical

Set orientation="vertical" on bq-tab-group to stack tabs in a column beside the content area.

No divider

Use disable-divider to hide the underline separator between the tab list and the content area.

Best practices

DoKeep tab labels short and parallel — prefer noun phrases like “Overview”, “Details”, or “Settings” rather than full sentences.

Don’tDon’t use tabs with only one or two items — a single visible section or a toggle is simpler and less visually heavy.

DoAlways provide a controls attribute on each bq-tab pointing to the id of its associated panel element to meet ARIA requirements.

Don’tDon’t mix tabs of different sizes in the same tab group. Set size on bq-tab-group and let it propagate uniformly.

DoUse consistent tab labels across your interface — if some tabs have icons, apply icons to all tabs in the same group.

Don’tDon’t use tabs for actions or commands. Tabs are for navigation between content views, not for triggering operations like “Save” or “Delete”.

DoChoose the orientation that matches your layout — use horizontal tabs for top-of-content placement and vertical tabs for sidebar-style navigation.

Don’tDon’t rely solely on the active-indicator underline for visual differentiation — ensure sufficient color contrast on the active tab label as well.

Accessibility

bq-tab-group and bq-tab implement the ARIA Tabs pattern:
  • The tab list container has role="tablist".
  • Each bq-tab renders as a <button role="tab"> with aria-selected and aria-disabled set automatically.
  • The controls prop maps to aria-controls, linking each tab to its panel. Always provide a matching id on the panel element and role="tabpanel" for correct screen reader announcements.
  • Keyboard navigation is handled by the tab group:
    • ArrowRight / ArrowDown — move focus to the next enabled tab
    • ArrowLeft / ArrowUp — move focus to the previous enabled tab
  • Focus management follows the roving tabindex pattern: only the active tab is in the tab order; other tabs are reachable via arrow keys.
  • Disabled tabs have aria-disabled="true" and disabled set on the underlying button, removing them from interaction.
Your responsibilities:
  • Provide a meaningful controls value on each bq-tab that matches the id of the corresponding panel.
  • Add role="tabpanel" to each panel element.
  • When using icons without a visible label, add a descriptive aria-label to the bq-tab so screen readers can identify the tab.

API reference

bq-tab-group

Properties

PropertyAttributeDescriptionTypeDefault
debounceTimedebounce-timeDelay in milliseconds before bqChange firesnumber0
disableDividerdisable-dividerIf true, the underline divider is hiddenbooleanfalse
orientationorientationLayout direction of the tab list"horizontal" | "vertical""horizontal"
placementplacementAlignment of tabs within the group"start" | "end""start"
sizesizeSize applied to all child tabs"small" | "medium" | "large""medium"
valuevalueThe tab-id of the currently selected tabstring

Events

EventDescriptionType
bqChangeFired when the selected tab changesCustomEvent<{ target: HTMLBqTabElement; value: string }>

Slots

SlotDescription
(default)The bq-tab items to render inside the group

Shadow parts

PartDescription
baseThe outer <div> wrapper
tabsThe <div role="tablist"> holding all tab buttons

bq-tab

Properties

PropertyAttributeDescriptionTypeDefault
activeactiveIf true, the tab is rendered in its active statebooleanfalse
controls (required)controlsThe id of the panel element this tab controlsstring
disableddisabledIf true, the tab is non-interactivebooleanfalse
orientationorientationLayout direction — propagated automatically by bq-tab-group"horizontal" | "vertical""horizontal"
placementplacementAlignment — propagated automatically by bq-tab-group"start" | "end""start"
sizesizeSize — propagated automatically by bq-tab-group"small" | "medium" | "large""medium"
tabId (required)tab-idUnique identifier used to match the tab to its panelstring

Events

EventDescriptionType
bqClickFired when the tab is clicked or activatedCustomEvent<HTMLBqTabElement>
bqFocusFired when the tab receives focusCustomEvent<HTMLBqTabElement>
bqBlurFired when the tab loses focusCustomEvent<HTMLBqTabElement>
bqKeyDownFired when a key is pressed while the tab is focusedCustomEvent<KeyboardEvent>

Methods

MethodDescriptionSignature
vClick()Simulates a click on the underlying <button> elementvClick() => Promise<void>
vFocus()Sets focus on the underlying <button> elementvFocus() => Promise<void>
vBlur()Removes focus from the underlying <button> elementvBlur() => Promise<void>

Slots

SlotDescription
(default)The tab label text
iconAn optional icon to display before the label

Shadow parts

PartDescription
baseThe <button> element
contentThe <div> wrapping the icon and text
iconThe <div> holding the slotted icon
textThe <div> holding the slotted label text
underlineThe element that renders the active-state underline indicator

CSS custom properties

Resources

Interactive playground

Explore Tab variants and states in Storybook

Source code

View the component source on GitHub