Tab navigation with optional content for the active tab.
| Prop | Type | Default | Meaning |
|---|---|---|---|
dataSource | TxSource<string | Item> | undefined | undefined | List, configuration or DataSource instance; takes precedence over items. |
items | (string | Item)[] | undefined | [] | Entries; replaced by dataSource when bound. |
selectedIndex | number | undefined | undefined | Zero-based active entry. |
modelValue | number | undefined | undefined | Controlled v-model value. |
disabled | boolean | undefined | false | Disables interaction. |
label | string | undefined | Reiter | Label or accessible name. |
orientation | string | undefined | horizontal | Tab orientation. |
scrollByContent | boolean | undefined | true | Allows scrolling through tab content. |
swipeEnabled | boolean | undefined | false | Allows switching tabs by swiping. |
Events
| Event | Payload / behavior |
|---|---|
| update:modelValue | New modelValue value; accept using v-model:modelValue (modelValue: v-model). |
| update:selectedIndex | New selectedIndex value; accept using v-model:selectedIndex (modelValue: v-model). |
| selectionChanged | New selection: { selectedIndex, itemData }. |
Slots
| Slot | Arguments |
|---|---|
| default | { selectedIndex, item } |
<script setup lang="ts">
import { TxTabs } from '@tekocloud.de/tecexpress'
import '@tekocloud.de/tecexpress/themes/index.css'
</script>
<template>
<TxTabs :items="[{ text: 'Home' }, { text: 'Settings' }]">
<template #default="{ selectedIndex }">Page {{ selectedIndex + 1 }}</template>
</TxTabs>
</template>