Skip to content

Tabs ​

A flexible tabs component for organizing content into switchable panels. Keyboard accessible, with a sliding active pill, and available in five visual styles.

Pointer selection slides the active pill; keyboard selection places it immediately. Panels reveal without an entrance animation so repeated navigation stays immediate.

Variants ​

Solid (Default) ​

Pill-style tabs in a rounded container: clean and contained.

Full width

Flat ​

Tabs and panel share a single container background: they read as one unified block. Use variant="flat" when tabs need to feel visually connected to the panel content below them.

Full width

Bordered ​

Tabs that visually connect to their panel with a shared border. Use variant="bordered" when tabs need to feel visually connected to the panel content below them.

Full width

Ghost ​

Open tabs with a filled active pill: no container border, floats freely.

Full width

Frost Variant ​

frost renders the tablist as a diffuse translucent capsule with adaptive tint and backdrop blur.

Best Used With

Use frost for floating navigation over content or imagery, and avoid placing it over another translucent control.

Full width

Colors ​

Set color on ore-tabs to apply a theme color: it propagates automatically to all tab items. The color drives the active pill fill on ghost, the focus ring on all variants, and the indicator line on future underline-style usage.

Full width

Sizes ​

Full width

Full Width ​

Add fullwidth to fill the parent container and distribute horizontal tabs evenly. It works with every variant, with or without panels. Without it, navigation-only tabs keep their content width. In vertical orientation, the host fills the container while the tab list keeps its content width.

Full width

Compact Density ​

Use density="compact" for dense toolbars, filters, table controls, and secondary navigation. It uses tighter 8px/12px padding, a single-line line-height, and a 24px minimum height while preserving selection, focus, keyboard navigation, colors, and visual variants. Density only tightens spacing: the label keeps the size your size prop asks for, and the corner radius is untouched — set rounded when you want a different shape. Standard density remains the default for primary content navigation. On a coarse pointer the target stays 44px even in compact density, because WCAG 2.2 §2.5.8 is a pointer requirement rather than a density preference.

Full width

Rounded ​

rounded sets the outer corner radius from the theme scale. On inset variants (solid, flat, bordered, and frost), the sliding active indicator and tab buttons share an inner radius: max(0px, outer radius − padding − enclosing border width), following Cloud Four's nested-corner geometry. This also keeps hover fills aligned with the indicator. ghost has no enclosing border or padding, so its surfaces keep the full radius. Use rounded="full" (or a bare rounded) for a pill shape. Density deliberately does not touch radius.

Full width

Vertical Tabs ​

Use orientation="vertical" to place the tab list on the side. This works well for settings pages, account sections, or docs-style navigation.

Full width

Vertical + Manual Activation ​

For keyboard-heavy interfaces, pair vertical tabs with activation="manual" so arrow keys move focus and Enter/Space commits selection.

Full width

Customization ​

Icons & Badges ​

Use the prefix and suffix slots on ore-tab-item to add icons or notification badges. Keep tab labels short and descriptive (ideally 1–3 words).

Full width

Selection Animation ​

The selected tab is marked by a single pill that slides from the old tab to the new one, carrying the variant's active surface with it. The travel uses --tabs-transition; set it to none (or honor prefers-reduced-motion, which Refine already applies) to make selection instant. Style the pill through ::part(indicator) and --tabs-indicator-color. Because the pill paints the active surface, ore-tab-item no longer paints its own active background by default: set --tab-item-active-bg on an item only when you want it to paint its own fill instead of the pill.

States ​

ore-tab-panel children are optional. When tabs are used only as a navigation control, omit the panels; the component removes the empty panel region and shrink-wraps to the tablist instead of stretching to the container width. Set width: 100% on the element to fill the container anyway.

html
<ore-tabs value="campaign" variant="frost" label="Campaign destinations">
  <ore-tab-item slot="tabs" value="campaign">Campaign</ore-tab-item>
  <ore-tab-item slot="tabs" value="party">Party</ore-tab-item>
  <ore-tab-item slot="tabs" value="overview">Overview</ore-tab-item>
</ore-tabs>

Lazy Panels ​

Add lazy to a ore-tab-panel to defer rendering its slot content until the tab is first activated. Once activated, the content stays rendered even if the tab is later switched away. This is useful for panels containing expensive components or data-fetching logic.

html
<ore-tabs value="tab1">
  <ore-tab-item slot="tabs" value="tab1">Quick</ore-tab-item>
  <ore-tab-item slot="tabs" value="tab2">Heavy</ore-tab-item>

  <ore-tab-panel value="tab1"><p>Rendered immediately.</p></ore-tab-panel>
  <ore-tab-panel value="tab2" lazy>
    <!-- Only rendered after the "Heavy" tab is first clicked -->
    <my-heavy-component></my-heavy-component>
  </ore-tab-panel>
</ore-tabs>

Disabled Tabs ​

Prevent specific tabs from being selected. Disabled tabs are skipped during keyboard navigation and have aria-disabled="true".

Full width

Keyboard Navigation ​

KeyAction
ArrowRightMove to the next tab (wraps around)
ArrowLeftMove to the previous tab (wraps around)
HomeJump to the first tab
EndJump to the last tab

Disabled tabs are skipped during keyboard navigation.

API Reference ​

ore-tabs Attributes

AttributeTypeDefaultDescription
valuestringN/AValue of the currently selected tab
variant'solid' | 'flat' | 'bordered' | 'ghost' | 'frost''solid'Visual style of the tab bar
size'sm' | 'md' | 'lg''md'Size applied to all tab items
density'default' | 'compact''default'Spatial density; compact tightens padding (24px minimum height, 44px on coarse pointers)
fullwidthbooleanfalseFill the container width and distribute horizontal tabs evenly
rounded'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full''lg'Outer corner radius; inset tab surfaces derive a smaller radius
color'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'N/ATheme color propagated to all tab items
orientation'horizontal' | 'vertical''horizontal'Tab list layout direction
activation'auto' | 'manual''auto'auto: arrow keys select immediately; manual: Enter/Space confirms

ore-tabs Events

EventDetailDescription
change{ value: string }Fired when the active tab changes

ore-tabs Slots

SlotDescription
tabsPlace ore-tab-item elements here
(default)Place ore-tab-panel elements here

ore-tab-item Attributes

AttributeTypeDefaultDescription
valuestringN/ARequired. Must match the corresponding ore-tab-panel value
activebooleanfalseWhether this tab is selected (managed by ore-tabs)
disabledbooleanfalsePrevents the tab from being selected
density'default' | 'compact'inheritedInherited from parent ore-tabs
rounded'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'inheritedInherited from parent ore-tabs
size'sm' | 'md' | 'lg'inheritedInherited from parent ore-tabs
variantstringinheritedInherited from parent ore-tabs
color'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'inheritedInherited from parent ore-tabs

ore-tab-item Slots

SlotDescription
prefixIcon or content before the label
(default)Tab label text
suffixBadge or count after the label

ore-tab-panel Attributes

AttributeTypeDefaultDescription
valuestringN/ARequired. Must match the corresponding ore-tab-item value
activebooleanfalseWhether this panel is visible (managed by ore-tabs)
lazybooleanfalseDefer rendering slot content until the panel is first activated

CSS Custom Properties

PropertyDefaultDescription
--tabs-radiusvar(--rounded-lg)Outer radius; indicator and tab buttons subtract enclosing padding and border width
--tabs-transitionvar(--transition-normal)Transition duration/easing for the sliding active pill
--tabs-indicator-colorVariant-dependentBackground of the sliding active pill
--tabs-bgTheme-dependentBackground of the host element (flat variant)
--tabs-tablist-bgTheme-dependentTablist container background (solid/frost variants)
--tabs-tablist-border-colorTheme-dependentTablist container border color
--tab-panel-paddingvar(--size-4)Padding inside each tab panel
--tab-item-radiusParent's inner radiusTab button radius; standalone items fall back to var(--rounded-lg)
--tab-item-paddingsize-dependentTab button padding
--tab-item-font-sizesize-dependentTab button font size (owned by size, never by density)
--tab-item-colorTheme-dependentDefault tab text color
--tab-item-hover-bgTheme-dependentTab background on hover
--tab-item-active-bgUnset (pill paints it)Opt-in item fill when active; unset lets the sliding pill show
--tab-item-active-colorTheme-dependentTab text color when active/selected
--tab-item-active-shadowUnset (pill paints it)Opt-in item shadow when active; unset lets the pill carry elevation

Accessibility ​

The tabs component follows the WAI-ARIA Tabs Pattern best practices. The tab list has role="tablist". Each tab has role="tab" with aria-selected and aria-controls pointing to its panel. Each panel has role="tabpanel" with aria-labelledby pointing to its tab. Disabled tabs have aria-disabled="true".

ArrowRight / ArrowLeft navigate between tabs; Home / End jump to first / last. Disabled tabs are skipped during keyboard navigation. Avoid nesting tabs inside tabs as it creates confusing navigation hierarchies. Do not use tabs to represent sequential steps; use a stepper component for linear flows. Limit to 5–7 tabs at most: consider a sidebar navigation for larger sets of sections.