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
Tabs component
Responsive horizontal navigation tabs, switch between contents with ease
html
<o-tabs></o-tabs>
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
animateInitially | Apply animation on the initial render | boolean | - | From config: tabs: { |
animated | Tab will have an animation | boolean | - | From config: tabs: { |
animation | Transition animation name | [string, string] | [string, string, string, string] | [next , prev] , [right , left , down , up] | From config: tabs: { |
destroyOnHide | Destroy tabItem on hide | boolean | - | false |
expanded | Tabs will be expanded (full-width) | boolean | - | false |
v-model | The selected item value, use v-model to make it two-way binding | string|number|object | - | |
multiline | Show tab items multiline when there is no space | boolean | - | false |
options | Tabs options, unnecessary when default slot is used | OptionsProp<string | number | object> | - | |
override | Override existing theme classes completely | boolean | - | |
position | Position of the tabs | "left" | "right" | "centered" | left , centered , right | |
size | Tab size | string | small , medium , large | From config: tabs: { |
type | Tab type | string | default , boxed , toggle , pills | From config: tabs: { |
variant | Color of the control | string | primary , info , success , warning , danger , and any other custom color | From config: tabs: { |
vertical | Show tab in vertical layout | boolean | - | From config: tabs: { |
Events
Event name | Properties | Description |
---|---|---|
update:modelValue | value string | number | object - updated modelValue prop | modelValue prop two-way binding |
change | value string | number | object - new tab valuevalue string | number | object - old tab value | on tab change event |
Slots
Name | Description | Bindings |
---|---|---|
start | Additional slot before tabs | |
end | Additional slot after tabs | |
default | Place tab items here |
TabItem component
html
<o-tab-item></o-tab-item>
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
ariaRole | - | From config: tabs: { | ||
component | - | |||
content | - | |||
disabled | - | false | ||
events | - | |||
icon | - | From config: tabs: { | ||
iconPack | - | From config: tabs: { | ||
label | - | |||
override | - | |||
props | - | |||
tag | - | From config: tabs: { | ||
value | - | |||
visible | - | true |
Events
Event name | Properties | Description |
---|---|---|
activate | on tab item activate event | |
deactivate | on tab item deactivate event |
Slots
Name | Description | Bindings |
---|---|---|
default | Tab item content | |
header | Override header label |
Sass variables
Current theme ➜ Oruga
SASS Variable | Default |
---|---|
$tabs-disabled-opacity | var(--#{$prefix}base-disabled-opacity) |
$tabs-font-size | var(--#{$prefix}base-font-size) |
$tabs-icon-margin | 0.5em |
$tabs-content-padding | 1rem |
$tabs-margin-bottom | 1.5rem |
$tabs-border-bottom-color | var(--#{$prefix}grey-lighter) |
$tabs-border-bottom-style | solid |
$tabs-border-bottom-width | 1px |
$tabs-link-color | hsl(0, 0%, 29%) |
$tabs-link-active-border-bottom-color | var(--#{$prefix}primary) |
$tabs-link-active-color | var(--#{$prefix}primary) |
$tabs-link-line-height | var(--#{$prefix}base-line-height) |
$tabs-link-padding | 0.5em 1em |
$tabs-boxed-link-radius | var(--#{$prefix}base-border-radius) |
$tabs-boxed-link-hover-background-color | hsl(0, 0%, 96%) |
$tabs-boxed-link-hover-border-bottom-color | hsl(0, 0%, 86%) |
$tabs-boxed-link-active-background-color | hsl(0, 0%, 100%) |
$tabs-boxed-link-active-border-color | hsl(0, 0%, 86%) |
$tabs-boxed-link-active-border-bottom-color | transparent |
$tabs-toggle-link-border-color | hsl(0, 0%, 86%) |
$tabs-toggle-link-border-style | solid |
$tabs-toggle-link-border-width | 1px |
$tabs-toggle-link-hover-background-color | hsl(0, 0%, 96%) |
$tabs-toggle-link-hover-border-color | hsl(0, 0%, 71%) |
$tabs-toggle-link-active-background-color | var(--#{$prefix}primary) |
$tabs-toggle-link-active-border-color | var(--#{$prefix}primary) |
$tabs-toggle-link-active-color | var(--#{$prefix}primary-invert) |
See ➜ 📄 Full scss file
Current theme ➜ Bulma
SASS Variable | Default |
---|---|
$tabs-focused-outline | none |
$tabs-link-focus-border-bottom-color | css.getVar( "tabs-link-hover-border-bottom-color") |
$tabs-link-focus-active-border-bottom-color | css.getVar( "tabs-link-active-border-bottom-color") |
$tabs-boxed-link-focus-active-background-color | css.getVar( "tabs-boxed-link-active-background-color") |
$tabs-boxed-link-focus-background-color | css.getVar( "tabs-boxed-link-hover-background-color") |
$tabs-boxed-link-focus-active-border-bottom-color | css.getVar( "tabs-boxed-link-active-border-bottom-color") |
$tabs-boxed-link-focus-border-bottom-color | css.getVar( "tabs-boxed-link-hover-border-bottom-color") |
$tabs-toggle-link-focus-active-background-color | css.getVar( "tabs-toggle-link-active-background-color") |
$tabs-toggle-link-focus-background-color | css.getVar( "tabs-toggle-link-hover-background-color") |
$tabs-toggle-link-focus-active-border-color | css.getVar( "tabs-toggle-link-active-border-color") |
$tabs-toggle-link-focus-border-color | css.getVar( "tabs-toggle-link-hover-border-color") |
See ➜ 📄 Full scss file
Current theme ➜ Bootstrap
SASS Variable | Default |
---|---|
$nav-tabs-color | var(--#{$prefix}body-color) |
$nav-tabs-spacer | $spacer |
$nav-tabs-disabled-opacity | 0.5 |
$nav-underline-link-active-bg | $nav-tabs-link-active-bg |
$nav-underline-link-active-border-color | currentcolor |
See ➜ 📄 Full scss file