Skip to content

Tabs ​

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

Basic ​

Content of the first tab.
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 ​

First panel.
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.

Three new messages.
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
}

Keyboard ​

The tablist is a single stop in the tab order: Tab reaches the selected tab, and the arrows move between them. Disabled tabs are skipped, and the selection follows the focus.

KeyDoes
← →Previous / next tab. ↑ ↓ when vertical.
Home EndFirst / last tab.
TabOut of the tablist and into the panel.

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-N—Panel content, starting at tab-1.