Skip to content

Tabs

te-tabs switches between panels. Titles can be plain strings or objects.

Basic

vue
<te-tabs v-model="tab" :titles="['First', 'Second', 'Third']">
  <template #tab-1>Content of the first tab.</template>
  <template #tab-2>Content of the second tab.</template>
  <template #tab-3>Content of the third tab.</template>
</te-tabs>

Pills, filled and disabled titles

vue
<te-tabs v-model="tab" pills filled :titles="[{ label: 'One' }, { label: 'Two', disabled: true }]">
  <template #tab-1>First panel.</template>
  <template #tab-2>Second panel.</template>
</te-tabs>

With a notification badge

notification takes the props of te-notification.

vue
<te-tabs v-model="tab" :titles="[{ label: 'Inbox', notification: { text: '3', color: 'danger' } }, 'Archive']">
  <template #tab-1>Three new messages.</template>
  <template #tab-2>Nothing here.</template>
</te-tabs>

TabTitle

ts
interface TabTitle {
  label?: string;
  disabled?: boolean;
  notification?: Record<string, unknown>;  // props for te-notification
}

Props

PropTypeDefaultDescription
modelValuenumber0Index of the open tab. Supports v-model.
titles`(TabTitlestring)[]`— (required)
pillsbooleanfalsePill styling instead of an underline.
filledbooleanfalseTitles share the full width.
verticalbooleanfalseTitles on the left, panels on the right.

Events

EventPayloadDescription
update:modelValuenumberThe open tab changed.

Slots

SlotPropsDescription
tab-NPanel content, starting at tab-1.

Released under the MIT License.