Skip to content

Tabs

Responsive horizontal navigation tabs, switch between contents with ease

Examples

Base

Show code

Types

Show code

Position

Show code

Expanded

Show code

Sizes

Show code

Vertical

Show code

Custom header

Show code

Long header

Show code

Class props

'Classes applied to the element'

Tabs component

Responsive horizontal navigation tabs, switch between contents with ease

html
<o-tabs></o-tabs>

Props

Prop nameDescriptionTypeValuesDefault
animateInitiallyApply animation on the initial renderboolean-
From config:
tabs: {
  animateInitially: false
}
animatedTab will have an animationboolean-
From config:
tabs: {
  animated: true
}
animationTransition animation name[string, string] | [string, string, string, string][next, prev], [right, left, down, up]
From config:
tabs: {
  animation: [ "slide-next", "slide-prev", "slide-down", "slide-up",]
}
destroyOnHideDestroy tabItem on hideboolean-false
expandedTabs will be expanded (full-width)boolean-false
v-modelThe selected item value, use v-model to make it two-way bindingstring|number|object-
multilineShow tab items multiline when there is no spaceboolean-false
optionsTabs options, unnecessary when default slot is usedOptionsProp<string | number | object>-
overrideOverride existing theme classes completelyboolean-
positionPosition of the tabs"left" | "right" | "centered"left, centered, right
sizeTab sizestringsmall, medium, large
From config:
tabs: {
  size: undefined
}
typeTab typestringdefault, boxed, toggle, pills
From config:
tabs: {
  type: "default"
}
variantColor of the controlstringprimary, info, success, warning, danger, and any other custom color
From config:
tabs: {
  variant: undefined
}
verticalShow tab in vertical layoutboolean-
From config:
tabs: {
  vertical: false
}

Events

Event namePropertiesDescription
update:modelValuevalue string | number | object - updated modelValue propmodelValue prop two-way binding
changevalue string | number | object - new tab value
value string | number | object - old tab value
on tab change event

Slots

NameDescriptionBindings
startAdditional slot before tabs
endAdditional slot after tabs
defaultPlace tab items here

TabItem component

html
<o-tab-item></o-tab-item>

Props

Prop nameDescriptionTypeValuesDefault
ariaRole-
From config:
tabs: {
  ariaRole: "tabpanel"
}
component-
content-
disabled-false
events-
icon-
From config:
tabs: {
  icon: undefined
}
iconPack-
From config:
tabs: {
  iconPack: undefined
}
label-
override-
props-
tag-
From config:
tabs: {
  itemTag: "button"
}
value-
visible-true

Events

Event namePropertiesDescription
activateon tab item activate event
deactivateon tab item deactivate event

Slots

NameDescriptionBindings
defaultTab item content
headerOverride header label

Sass variables

Current theme ➜ Oruga

SASS VariableDefault
$tabs-disabled-opacityvar(--#{$prefix}base-disabled-opacity)
$tabs-font-sizevar(--#{$prefix}base-font-size)
$tabs-icon-margin0.5em
$tabs-content-padding1rem
$tabs-margin-bottom1.5rem
$tabs-border-bottom-colorvar(--#{$prefix}grey-lighter)
$tabs-border-bottom-stylesolid
$tabs-border-bottom-width1px
$tabs-link-colorhsl(0, 0%, 29%)
$tabs-link-active-border-bottom-colorvar(--#{$prefix}primary)
$tabs-link-active-colorvar(--#{$prefix}primary)
$tabs-link-line-heightvar(--#{$prefix}base-line-height)
$tabs-link-padding0.5em 1em
$tabs-boxed-link-radiusvar(--#{$prefix}base-border-radius)
$tabs-boxed-link-hover-background-colorhsl(0, 0%, 96%)
$tabs-boxed-link-hover-border-bottom-colorhsl(0, 0%, 86%)
$tabs-boxed-link-active-background-colorhsl(0, 0%, 100%)
$tabs-boxed-link-active-border-colorhsl(0, 0%, 86%)
$tabs-boxed-link-active-border-bottom-colortransparent
$tabs-toggle-link-border-colorhsl(0, 0%, 86%)
$tabs-toggle-link-border-stylesolid
$tabs-toggle-link-border-width1px
$tabs-toggle-link-hover-background-colorhsl(0, 0%, 96%)
$tabs-toggle-link-hover-border-colorhsl(0, 0%, 71%)
$tabs-toggle-link-active-background-colorvar(--#{$prefix}primary)
$tabs-toggle-link-active-border-colorvar(--#{$prefix}primary)
$tabs-toggle-link-active-colorvar(--#{$prefix}primary-invert)

See ➜ 📄 Full scss file

Current theme ➜ Bulma

SASS VariableDefault
$tabs-focused-outlinenone
$tabs-link-focus-border-bottom-colorcss.getVar( "tabs-link-hover-border-bottom-color")
$tabs-link-focus-active-border-bottom-colorcss.getVar( "tabs-link-active-border-bottom-color")
$tabs-boxed-link-focus-active-background-colorcss.getVar( "tabs-boxed-link-active-background-color")
$tabs-boxed-link-focus-background-colorcss.getVar( "tabs-boxed-link-hover-background-color")
$tabs-boxed-link-focus-active-border-bottom-colorcss.getVar( "tabs-boxed-link-active-border-bottom-color")
$tabs-boxed-link-focus-border-bottom-colorcss.getVar( "tabs-boxed-link-hover-border-bottom-color")
$tabs-toggle-link-focus-active-background-colorcss.getVar( "tabs-toggle-link-active-background-color")
$tabs-toggle-link-focus-background-colorcss.getVar( "tabs-toggle-link-hover-background-color")
$tabs-toggle-link-focus-active-border-colorcss.getVar( "tabs-toggle-link-active-border-color")
$tabs-toggle-link-focus-border-colorcss.getVar( "tabs-toggle-link-hover-border-color")

See ➜ 📄 Full scss file

Current theme ➜ Bootstrap

SASS VariableDefault
$nav-tabs-colorvar(--#{$prefix}body-color)
$nav-tabs-spacer$spacer
$nav-tabs-disabled-opacity0.5
$nav-underline-link-active-bg$nav-tabs-link-active-bg
$nav-underline-link-active-border-colorcurrentcolor

See ➜ 📄 Full scss file

Released under the MIT License.