Skip to content
Ringobook v3.27.0

Tabs

Tabs allow users to organize related content into multiple sections that occupy the same space, with only one section visible at a time. 🗂️

You can install the Tabs component using the global design system bundle or as a standalone script.

<script src="https://webcdn.ringover.com/app/download/design-system/lts/design-system.js"></script>
<script>
const { RoTabs } = RingoUI;
customElements.define('ro-tabs', RoTabs);
</script>
<script src="https://webcdn.ringover.com/app/download/design-system/lts/components/tabs.js"></script>
<script>
customElements.define('ro-tabs', RoTabs.RoTabs);
</script>

The default tab style uses an animated underline indicator. No variant class is required on .ro-tab-header.

Wrap labels in .ro-tab-item-label. The <ro-tabs> element handles switching logic and ARIA states.

<ro-tabs id="my-tabs">
<div class="ro-tab-header">
<div class="ro-tab-item">
<span class="ro-tab-item-label">Account</span>
</div>
<div class="ro-tab-item">
<span class="ro-tab-item-label">Settings</span>
</div>
<div class="ro-tab-item">
<span class="ro-tab-item-label">Notifications</span>
</div>
</div>
<div class="ro-tab-content">
<div class="ro-tab-panel">
<h3 class="ro-heading ro-level-4">Account Details</h3>
<p class="ro-text">Manage your account information here.</p>
</div>
<div class="ro-tab-panel">
<h3 class="ro-heading ro-level-4">Settings</h3>
<p class="ro-text">Update your preferences and privacy settings.</p>
</div>
<div class="ro-tab-panel">
<h3 class="ro-heading ro-level-4">Notifications</h3>
<p class="ro-text">View your recent alerts and messages.</p>
</div>
</div>
</ro-tabs>
Preview
Account
Settings
Notifications

Account Details

Manage your account information here.

Settings

Update your preferences and privacy settings.

Notifications

View your recent alerts and messages.

Add .ro-variant-secondary for a filled background with rounded active tabs and no underline.

<ro-tabs>
<div class="ro-tab-header ro-variant-secondary">
<div class="ro-tab-item">
<i class="ro-icon ro-icon-rocket"></i>
<span class="ro-tab-item-label">Tab 1</span>
</div>
<div class="ro-tab-item">
<i class="ro-icon ro-icon-rocket"></i>
<span class="ro-tab-item-label">Tab 2</span>
</div>
<div class="ro-tab-item">
<i class="ro-icon ro-icon-rocket"></i>
<span class="ro-tab-item-label">Tab 3</span>
</div>
</div>
<div class="ro-tab-content">
<div class="ro-tab-panel">Content for tab 1</div>
<div class="ro-tab-panel">Content for tab 2</div>
<div class="ro-tab-panel">Content for tab 3</div>
</div>
</ro-tabs>
Preview
Tab 1
Tab 2
Tab 3
Content for tab 1
Content for tab 2
Content for tab 3

Combine .ro-variant-secondary.ro-color-scheme-white for a bordered active state on light surfaces.

<ro-tabs>
<div class="ro-tab-header ro-variant-secondary ro-color-scheme-white">
<div class="ro-tab-item">
<span class="ro-tab-item-label">Overview</span>
</div>
<div class="ro-tab-item">
<span class="ro-tab-item-label">Details</span>
</div>
</div>
<div class="ro-tab-content">
<div class="ro-tab-panel">Overview content</div>
<div class="ro-tab-panel">Details content</div>
</div>
</ro-tabs>
Preview
Overview
Details
Overview content
Details content

Add .ro-dir-vertical on the header for a vertical secondary layout.

<ro-tabs>
<div class="ro-tab-header ro-variant-secondary ro-dir-vertical">
<div class="ro-tab-item">
<span class="ro-tab-item-label">Section A</span>
</div>
<div class="ro-tab-item">
<span class="ro-tab-item-label">Section B</span>
</div>
</div>
<div class="ro-tab-content">
<div class="ro-tab-panel">Section A content</div>
<div class="ro-tab-panel">Section B content</div>
</div>
</ro-tabs>
Preview
Section A
Section B
Section A content
Section B content

Add .ro-variant-tertiary for pill-shaped tabs with a filled active state.

<ro-tabs>
<div class="ro-tab-header ro-variant-tertiary">
<div class="ro-tab-item">
<i class="ro-icon ro-icon-rocket"></i>
<span class="ro-tab-item-label">Accent</span>
</div>
<div class="ro-tab-item">
<i class="ro-icon ro-icon-rocket"></i>
<span class="ro-tab-item-label">Neutral</span>
</div>
<div class="ro-tab-item">
<span class="ro-tab-item-label">Label only</span>
</div>
</div>
<div class="ro-tab-content">
<div class="ro-tab-panel">Content for tab 1</div>
<div class="ro-tab-panel">Content for tab 2</div>
<div class="ro-tab-panel">Content for tab 3</div>
</div>
</ro-tabs>
Preview
Accent
Neutral
Label only
Content for tab 1
Content for tab 2
Content for tab 3

Add .ro-size-sm to any tab header. .ro-size-lg applies to .ro-variant-tertiary only.

<ro-tabs>
<div class="ro-tab-header ro-variant-secondary ro-size-sm">
<div class="ro-tab-item"><span class="ro-tab-item-label">Small secondary</span></div>
<div class="ro-tab-item"><span class="ro-tab-item-label">Tab 2</span></div>
</div>
<div class="ro-tab-content">
<div class="ro-tab-panel">Content 1</div>
<div class="ro-tab-panel">Content 2</div>
</div>
</ro-tabs>
<ro-tabs>
<div class="ro-tab-header ro-variant-tertiary ro-size-lg">
<div class="ro-tab-item"><span class="ro-tab-item-label">Large tertiary</span></div>
<div class="ro-tab-item"><span class="ro-tab-item-label">Tab 2</span></div>
</div>
<div class="ro-tab-content">
<div class="ro-tab-panel">Content 1</div>
<div class="ro-tab-panel">Content for tab 2</div>
</div>
</ro-tabs>
Preview
Small secondary
Tab 2
Content 1
Content 2
Large tertiary
Tab 2
Content 1
Content 2

The following class is not shipped in @ringover/styles:

  • .ro-variant-underline — use the default primary style (no variant class) or .ro-variant-secondary / .ro-variant-tertiary.
Class / elementDescription
.ro-tab-header, .ro-tabs-listTab list container.
.ro-tab-item, .ro-tabs-triggerIndividual tab trigger.
.ro-tab-item-labelLabel text inside a tab item.
.ro-tab-content, .ro-tabs-contentPanel container.
.ro-tab-panelIndividual content panel.
.selected, .active, [data-state="active"]Active tab/panel states.
ClassDescription
(none)Primary — underline indicator (default).
.ro-variant-secondaryFilled background; rounded active tab.
.ro-variant-tertiaryPill-shaped tabs.
.ro-color-scheme-whiteWith secondary — bordered active tab on light surfaces.
.ro-dir-verticalWith secondary — vertical tab list.
.ro-size-smCompact tab height (all variants).
.ro-size-lgLarger tertiary tabs only.
.ro-variant-tertiary.ro-size-smCompact tertiary pills.

You can listen for the tab-change event to perform actions when a new tab is selected.

Event NameDetailDescription
tab-change{ groupId, index, tab, panel }Fired when a tab is activated.
const tabs = document.querySelector("#my-tabs");
tabs.addEventListener("tab-change", (event) => {
const { index, groupId } = event.detail;
console.log(`Switched to tab ${index} in group ${groupId}`);
});

Changelog

Recent updates in @ringover/styles. See the full package changelog .

@ringover/styles@3.26.0
  • Refined active state colors using accent-active tokens for improved theming.
@ringover/styles@3.18.1
  • Updated hover backgrounds to grey for interactive tab items.
@ringover/styles@3.11.0
  • Aligned tabs with design review — tertiary variant, Figma paddings, and active state.