Tabs
Responsive horizontal navigation tabs, switch between contents with ease
Examples
Base
Show code
Types
Show code
Position
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[] | [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 | string|number|object | - | 0 |
multiline | Show tab items multiline when there is no space | boolean | - | false |
override | Override existing theme classes completely | boolean | - | |
position | Position of the tabs | string | left , centered , right | |
size | Tab size | string | small , medium , large | From config: tabs: { |
type | Tab type | string | boxed , toggle | 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 | Role attribute to be passed to the div wrapper for better accessibility. | string | - | From config: tabs: { |
disabled | Item will be disabled | boolean | - | false |
icon | Icon on the left | string | - | From config: tabs: { |
iconPack | Icon pack | string | - | From config: tabs: { |
label | Item label | string | - | |
override | Override existing theme classes completely | boolean | - | |
tag | Tabs item tag name | DynamicComponent | - | From config: tabs: { |
value | Item value (it will be used as v-model of wrapper component) - default is a uuid | string|number|object | - | Default function (see source code) |
visible | Show/hide item | boolean | - | 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
The theme does not have any custom variables for this component.
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