# Vue Bootstrap Tabs Component

> Learn how to use CoreUI’s Vue Tabs component with Bootstrap styles for flexible, framework-consistent UI.

## Example

The basic Vue tabs example uses the `variant="tabs"` props to generate a tabbed interface.

```html
<template>
  <CTabs activeItemKey="profile">
    <CTabList variant="tabs">
      <CTab itemKey="home">Home</CTab>
      <CTab itemKey="profile">Profile</CTab>
      <CTab itemKey="contact">Contact</CTab>
      <CTab disabled itemKey="disabled">Disabled</CTab>
    </CTabList>
    <CTabContent>
      <CTabPanel class="p-3" itemKey="home"> Home tab content </CTabPanel>
      <CTabPanel class="p-3" itemKey="profile"> Profile tab content </CTabPanel>
      <CTabPanel class="p-3" itemKey="contact"> Contact tab content </CTabPanel>
      <CTabPanel class="p-3" itemKey="disabled"> Disabled tab content </CTabPanel>
    </CTabContent>
  </CTabs>
</template>

<script setup>
import { CTabs, CTabList, CTab, CTabContent, CTabPanel } from '@coreui/vue'
</script>
```
  
</Example>

## Available styles

Change the style of `<CTabs>`'s component with modifiers and utilities. Mix and match as needed, or build your own.

### Unstyled

If you don’t provide the `variant` prop, the component will default to a basic style.

```html
<template>
  <CTabs activeItemKey="profile">
    <CTabList>
      <CTab itemKey="home">Home</CTab>
      <CTab itemKey="profile">Profile</CTab>
      <CTab itemKey="contact">Contact</CTab>
      <CTab disabled itemKey="disabled">Disabled</CTab>
    </CTabList>
    <CTabContent>
      <CTabPanel class="p-3" itemKey="home"> Home tab content </CTabPanel>
      <CTabPanel class="p-3" itemKey="profile"> Profile tab content </CTabPanel>
      <CTabPanel class="p-3" itemKey="contact"> Contact tab content </CTabPanel>
      <CTabPanel class="p-3" itemKey="disabled"> Disabled tab content </CTabPanel>
    </CTabContent>
  </CTabs>
</template>

<script setup>
import { CTabs, CTabList, CTab, CTabContent, CTabPanel } from '@coreui/vue'
</script>
```
  
</Example>

### Pills

Take that same code, but use `variant="pills"` instead:

```html
<template>
  <CTabs :activeItemKey="2">
    <CTabList variant="pills">
      <CTab aria-controls="home-tab-pane" :itemKey="1">Home</CTab>
      <CTab aria-controls="profile-tab-pane" :itemKey="2">Profile</CTab>
      <CTab aria-controls="contact-tab-pane" :itemKey="3">Contact</CTab>
      <CTab aria-controls="disabled-tab-pane" disabled :itemKey="4">Disabled</CTab>
    </CTabList>
    <CTabContent>
      <CTabPanel class="p-3" aria-labelledby="home-tab-pane" :itemKey="1">
        Home tab content
      </CTabPanel>
      <CTabPanel class="p-3" aria-labelledby="profile-tab-pane" :itemKey="2">
        Profile tab content
      </CTabPanel>
      <CTabPanel class="p-3" aria-labelledby="contact-tab-pane" :itemKey="3">
        Contact tab content
      </CTabPanel>
      <CTabPanel class="p-3" aria-labelledby="disabled-tab-pane" :itemKey="4">
        Disabled tab content
      </CTabPanel>
    </CTabContent>
  </CTabs>
</template>

<script setup>
import { CTabs, CTabList, CTab, CTabContent, CTabPanel } from '@coreui/vue'
</script>
```
  
</Example>

### Underline

Take that same code, but use `variant="underline"` instead:

```html
<template>
  <CTabs :activeItemKey="2">
    <CTabList variant="underline">
      <CTab aria-controls="home-tab-pane" :itemKey="1">Home</CTab>
      <CTab aria-controls="profile-tab-pane" :itemKey="2">Profile</CTab>
      <CTab aria-controls="contact-tab-pane" :itemKey="3">Contact</CTab>
      <CTab aria-controls="disabled-tab-pane" disabled :itemKey="4">Disabled</CTab>
    </CTabList>
    <CTabContent>
      <CTabPanel class="py-3" aria-labelledby="home-tab-pane" :itemKey="1">
        Home tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="profile-tab-pane" :itemKey="2">
        Profile tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="contact-tab-pane" :itemKey="3">
        Contact tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="disabled-tab-pane" :itemKey="4">
        Disabled tab content
      </CTabPanel>
    </CTabContent>
  </CTabs>
</template>

<script setup>
import { CTabs, CTabList, CTab, CTabContent, CTabPanel } from '@coreui/vue'
</script>
```
  
</Example>

### Underline border

Take that same code, but use `variant="underline-border"` instead:

```html
<template>
  <CTabs :activeItemKey="2">
    <CTabList variant="underline-border">
      <CTab aria-controls="home-tab-pane" :itemKey="1">Home</CTab>
      <CTab aria-controls="profile-tab-pane" :itemKey="2">Profile</CTab>
      <CTab aria-controls="contact-tab-pane" :itemKey="3">Contact</CTab>
      <CTab aria-controls="disabled-tab-pane" disabled :itemKey="4">Disabled</CTab>
    </CTabList>
    <CTabContent>
      <CTabPanel class="py-3" aria-labelledby="home-tab-pane" :itemKey="1">
        Home tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="profile-tab-pane" :itemKey="2">
        Profile tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="contact-tab-pane" :itemKey="3">
        Contact tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="disabled-tab-pane" :itemKey="4">
        Disabled tab content
      </CTabPanel>
    </CTabContent>
  </CTabs>
</template>

<script setup>
import { CTabs, CTabList, CTab, CTabContent, CTabPanel } from '@coreui/vue'
</script>
```
  
</Example>

### Enclosed

Use the `variant="enclosed"` class to give your tab items a subtle border and rounded styling.

```html
<template>
  <CTabs :activeItemKey="1">
    <CTabList variant="enclosed">
      <CTab aria-controls="home-tab-pane" :itemKey="1">Home</CTab>
      <CTab aria-controls="profile-tab-pane" :itemKey="2">Profile</CTab>
      <CTab aria-controls="contact-tab-pane" :itemKey="3">Contact</CTab>
      <CTab aria-controls="disabled-tab-pane" disabled :itemKey="4">Disabled</CTab>
    </CTabList>
    <CTabContent>
      <CTabPanel class="py-3" aria-labelledby="home-tab-pane" :itemKey="1">
        Home tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="profile-tab-pane" :itemKey="2">
        Profile tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="contact-tab-pane" :itemKey="3">
        Contact tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="disabled-tab-pane" :itemKey="4">
        Disabled tab content
      </CTabPanel>
    </CTabContent>
  </CTabs>
</template>

<script setup>
import { CTabs, CTabList, CTab, CTabContent, CTabPanel } from '@coreui/vue'
</script>
```
  
</Example>

### Enclosed pills 

Use the `variant="enclosed-pills"` to achieve a pill-style appearance for each tab item, using pill-shaped borders and smoother outlines.

```html
<template>
  <CTabs :activeItemKey="1">
    <CTabList variant="enclosed-pills">
      <CTab aria-controls="home-tab-pane" :itemKey="1">Home</CTab>
      <CTab aria-controls="profile-tab-pane" :itemKey="2">Profile</CTab>
      <CTab aria-controls="contact-tab-pane" :itemKey="3">Contact</CTab>
      <CTab aria-controls="disabled-tab-pane" disabled :itemKey="4">Disabled</CTab>
    </CTabList>
    <CTabContent>
      <CTabPanel class="py-3" aria-labelledby="home-tab-pane" :itemKey="1">
        Home tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="profile-tab-pane" :itemKey="2">
        Profile tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="contact-tab-pane" :itemKey="3">
        Contact tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="disabled-tab-pane" :itemKey="4">
        Disabled tab content
      </CTabPanel>
    </CTabContent>
  </CTabs>
</template>

<script setup>
import { CTabs, CTabList, CTab, CTabContent, CTabPanel } from '@coreui/vue'
</script>
```
  
</Example>

### Fill and justify

Force your `<CTabs>`'s contents to extend the full available width one of two modifier classes. To proportionately fill all available space use `layout="fill"`. Notice that all horizontal space is occupied, but not every nav item has the same width.

```html
<template>
  <CTabs :activeItemKey="2">
    <CTabList variant="tabs" layout="fill">
      <CTab aria-controls="home-tab-pane" :itemKey="1">Home</CTab>
      <CTab aria-controls="profile-tab-pane" :itemKey="2">Profile tab with longer content</CTab>
      <CTab aria-controls="contact-tab-pane" :itemKey="3">Contact</CTab>
      <CTab aria-controls="disabled-tab-pane" disabled :itemKey="4">Disabled</CTab>
    </CTabList>
    <CTabContent>
      <CTabPanel class="py-3" aria-labelledby="home-tab-pane" :itemKey="1">
        Home tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="profile-tab-pane" :itemKey="2">
        Profile tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="contact-tab-pane" :itemKey="3">
        Contact tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="disabled-tab-pane" :itemKey="4">
        Disabled tab content
      </CTabPanel>
    </CTabContent>
  </CTabs>
</template>

<script setup>
import { CTabs, CTabList, CTab, CTabContent, CTabPanel } from '@coreui/vue'
</script>
```
  
</Example>

For equal-width elements, use `layout="justified"`. All horizontal space will be occupied by nav links, but unlike the `layout="fill"` above, every nav item will be the same width.

```html
<template>
  <CTabs :activeItemKey="2">
    <CTabList variant="tabs" layout="justified">
      <CTab aria-controls="home-tab-pane" :itemKey="1">Home</CTab>
      <CTab aria-controls="profile-tab-pane" :itemKey="2">Profile</CTab>
      <CTab aria-controls="contact-tab-pane" :itemKey="3">Contact</CTab>
      <CTab aria-controls="disabled-tab-pane" disabled :itemKey="4">Disabled</CTab>
    </CTabList>
    <CTabContent>
      <CTabPanel class="py-3" aria-labelledby="home-tab-pane" :itemKey="1">
        Home tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="profile-tab-pane" :itemKey="2">
        Profile tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="contact-tab-pane" :itemKey="3">
        Contact tab content
      </CTabPanel>
      <CTabPanel class="py-3" aria-labelledby="disabled-tab-pane" :itemKey="4">
        Disabled tab content
      </CTabPanel>
    </CTabContent>
  </CTabs>
</template>

<script setup>
import { CTabs, CTabList, CTab, CTabContent, CTabPanel } from '@coreui/vue'
</script>
```
  
</Example>
