Navegação
VTabs
Ajudar o utilizador a navegar entre conteúdos relacionados dentro do mesmo contexto, mantendo a informação organizada e acessível. É navegação contextual (não muda de página): alterna painéis de conteúdo relacionado (ex.: Overview/Features/Pricing/FAQ, General/Team/Billing/Integrations, Home/Analytics/Settings/Security).
<script setup lang="ts">
import { VTabs } from 'vueui-nova-kit'
</script>Uso
<script setup lang="ts">
</script>
<template>
</template>Playground
Os controles abaixo são gerados a partir das props declaradas em VTabs.types.ts; o código acompanha cada mudança.
Exemplos
Variantes, tamanhos e estados, extraídos das stories da biblioteca.
Underline
Variação Underline.
Ver código
<script setup lang="ts">
import { VTabs } from 'vueui-nova-kit'
const items = [
{ value: 'overview', label: 'Overview', icon: 'home' },
{ value: 'features', label: 'Features' },
{ value: 'pricing', label: 'Pricing' },
{ value: 'faq', label: 'FAQ' },
]
</script>
<template>
<VTabs v-model="value" :items="items" />
</template>Pill
Variação Pill. Props: variant="pill".
Ver código
<script setup lang="ts">
import { VTabs } from 'vueui-nova-kit'
const items = [
{ value: 'general', label: 'General' },
{ value: 'team', label: 'Team' },
{ value: 'billing', label: 'Billing' },
{ value: 'integrations', label: 'Integrations' },
]
</script>
<template>
<VTabs v-model="value" variant="pill" :items="items" />
</template>Icon
Variação Ícone. Props: variant="icon".
Ver código
<script setup lang="ts">
import { VTabs } from 'vueui-nova-kit'
const items = [
{ value: 'home', label: 'Home', icon: 'home' },
{
value: 'analytics',
label: 'Analytics',
icon: 'analytics',
},
{ value: 'settings', label: 'Settings', icon: 'settings' },
{ value: 'security', label: 'Security', icon: 'security' },
]
</script>
<template>
<VTabs v-model="value" variant="icon" :items="items" />
</template>Small
Variação Pequeno. Props: size="sm".
Ver código
<script setup lang="ts">
import { VTabs } from 'vueui-nova-kit'
const items = [
{ value: 'overview', label: 'Overview', icon: 'home' },
{ value: 'features', label: 'Features' },
{ value: 'pricing', label: 'Pricing' },
{ value: 'faq', label: 'FAQ' },
]
</script>
<template>
<VTabs v-model="value" size="sm" :items="items" />
</template>Large
Variação Grande. Props: size="lg".
Ver código
<script setup lang="ts">
import { VTabs } from 'vueui-nova-kit'
const items = [
{ value: 'overview', label: 'Overview', icon: 'home' },
{ value: 'features', label: 'Features' },
{ value: 'pricing', label: 'Pricing' },
{ value: 'faq', label: 'FAQ' },
]
</script>
<template>
<VTabs v-model="value" size="lg" :items="items" />
</template>Disabled
Variação Desabilitado. Props: disabled=true.
Ver código
<script setup lang="ts">
import { VTabs } from 'vueui-nova-kit'
const items = [
{ value: 'overview', label: 'Overview' },
{ value: 'features', label: 'Features', disabled: true },
]
</script>
<template>
<VTabs v-model="value" :items="items" disabled />
</template>Dividers
Variação Dividers. Props: dividers=true.
Ver código
<script setup lang="ts">
import { VTabs } from 'vueui-nova-kit'
const items = [
{ value: 'overview', label: 'Overview', icon: 'home' },
{ value: 'features', label: 'Features' },
{ value: 'pricing', label: 'Pricing' },
{ value: 'faq', label: 'FAQ' },
]
</script>
<template>
<VTabs v-model="value" :items="items" dividers />
</template>Controlled VModel
Estado controlado: v-model ligado a um ref e exibido abaixo; as abas também podem ser trocadas por código.
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VTabs, VButton } from 'vueui-nova-kit'
const args = {
size: 'md',
variant: 'underline',
items: [
{
value: 'overview',
label: 'Overview',
icon: 'home'
},
{
value: 'features',
label: 'Features'
},
{
value: 'pricing',
label: 'Pricing'
},
{
value: 'faq',
label: 'FAQ'
}
]
}
const tab = ref('features')
</script>
<template>
<div style="display:grid;gap:12px"><VTabs v-bind="args" v-model="tab" /><code>v-model = {{ tab }}</code><VButton variant="ghost" size="sm" @click="tab = 'pricing'">Ir para Pricing</VButton></div>
</template>Acessibilidade
Semântica nativa primeiro, foco visível, labels acessíveis e teclado conforme o padrão WAI-ARIA correspondente.
Estados
Default · Hover · Focus-visible · Pressed/Active quando aplicável · Disabled · Loading quando aplicável.
Motion
| Trigger | Property | Duration | Easing |
|---|---|---|---|
| Hover | background/transform | 100ms | standard |
| Focus | outline/box-shadow | 100ms | standard |
| Enter/Exit | opacity/transform | 160ms | standard |
Respeitar prefers-reduced-motion.
Todas as transições respeitam prefers-reduced-motion e os tokens --v-duration-*.
Props
| Prop | Tipo | Default | Descrição |
|---|---|---|---|
modelValue | string | — | — |
items | VTabItem[] | — | — |
disabled | boolean | false | — |
size | VTabsSize | "md" | — |
variant | VTabsVariant | "underline" | — |
dividers | boolean | false | — |
panels | boolean | true | Renders the tabpanel area. Set `false` to use tabs as navigation (no tabpanel/aria-controls). Default `true`. |
ariaLabel | string | — | — |
Events
| Evento | Payload | Descrição |
|---|---|---|
@update:modelValue | value: string | — |
Slots
| Slot | Props do slot |
|---|---|
#actions | — |
#default | — |
Fonte: src/components/navigation/VTabs/VTabs.vue · tipos: src/components/navigation/VTabs/VTabs.types.ts