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 | Array<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 |
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: { |
v-model | string|number | - | 0 | |
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 - updated modelValue prop | modelValue prop two-way binding |
change | value string | number - new tab valuevalue string | number - 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) | string|number | - | 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 |
Sass variables
Current theme ➜ Oruga Base
SASS Variable | Default |
---|---|
$tabs-disabled-opacity | $base-disabled-opacity |
$tabs-font-size | $base-font-size |
$tabs-icon-margin | 0.5em |
$tabs-content-padding | 1rem |
$tabs-margin-bottom | 1.5rem |
$tabs-border-bottom-color | $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 | $primary |
$tabs-link-active-color | $primary |
$tabs-link-line-height | $base-line-height |
$tabs-link-padding | 0.5em 1em |
$tabs-boxed-link-radius | $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-radius | $base-border-radius |
$tabs-toggle-link-active-background-color | $primary |
$tabs-toggle-link-active-border-color | $primary |
$tabs-toggle-link-active-color | $primary-invert |
See ➜ 📄 Full scss file
Current theme ➜ Oruga Full
SASS Variable | Default |
---|---|
$tabs-disabled-opacity | $base-disabled-opacity |
$tabs-font-size | $base-font-size |
$tabs-icon-margin | 0.5em |
$tabs-content-padding | 1rem |
$tabs-margin-bottom | 1.5rem |
$tabs-border-bottom-color | $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 | $primary |
$tabs-link-active-color | $primary |
$tabs-link-line-height | $base-line-height |
$tabs-link-padding | 0.5em 1em |
$tabs-boxed-link-radius | $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-radius | $base-border-radius |
$tabs-toggle-link-active-background-color | $primary |
$tabs-toggle-link-active-border-color | $primary |
$tabs-toggle-link-active-color | $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