Skip to content

GkTabs

A tabbed interface with role="tablist" / role="tab" / role="tabpanel", v-model on the selected value, optional items (same parsing idea as Vuetify: primitives or { text, value, disabled }), or slot-based GkTab + #window with GkTabsWindowItem. Includes alignTabs, grow, fixedTabs, stacked, inset, slider styling, showArrows with prev / next slots, and keyboard navigation (Arrow, Home, End).

This is intentionally smaller than Vuetify’s VTabs + VSlideGroup + VWindow: no touch carousel, no Web Animations “shift” slider between tabs, and no strict slide-group overflow measurement for arrow disabling.

When to use

Use tabs to switch between related views that share a page context. Prefer items for data-driven tabs and slot-based tabs when panel markup needs full control.

Live demo

API

GkTabs

Props

PropTypeDefaultDescription
modelValuestring | number | undefinedfirst itemSelected tab value; v-model
alignTabs'start' | 'title' | 'center' | 'end''start'Main axis alignment of the tab row
colorstringSets --gk-tabs-color for the selected tab
bgColorstringSets --gk-tabs-bg-color
fixedTabsbooleanfalseEqual-width cap (max-width: 300px) per tab
growbooleanfalseTabs grow to fill the row
stackedbooleanfalseVertical label layout inside each tab
heightnumber | stringSets --gk-tabs-height (numbers become px)
hideSliderbooleanfalseHides the underline slider
insetbooleanfalseInset padding/radius on the tab strip
insetPaddingnumber | stringOverrides --gk-tabs-inset-padding when inset
insetRadiusnumber | stringOverrides --gk-tabs-inset-radius when inset
sliderColorstringSets --gk-tabs-slider-color
sliderTransition'fade' | 'grow' | 'shift''shift'Slider appearance transition
direction'horizontal' | 'vertical''horizontal'Tab bar axis
showArrowsbooleanfalseScroll arrows (horizontal only); prev / next slots
disabledbooleanfalseDisables changing tabs
spacedbooleanfalseGap between tab buttons
itemsGkTabItem[][]When non-empty, drives tabs and default panels

Slots

SlotPropsDescription
defaultGkTab children when items is empty
tabitemCustom label for items mode
tab.*iteme.g. tab.foo for value: 'foo'
itemitemPanel content for items mode
item.*itemPer-value panel slot
windowExtra panels when using slot-based tabs
prevLeft scroll control when showArrows
nextRight scroll control when showArrows

Events

EventPayload
update:modelValuestring | number | undefined

GkTab

PropTypeDefaultDescription
valuestring | numberrequiredTab id
disabledbooleanfalse
textstringDefault label

Use inside GkTabs (default slot). When GkTabs uses items, GkTab is created internally.

GkTabsWindow

Wrapper around panel content (single root). Usually omitted when GkTabs renders items panels automatically.

GkTabsWindowItem

PropTypeDescription
valuestring | numberMatches GkTab / items entry value

parseGkTabItems

Exported from god-kit/vue (and god-kit/vue/navigation) for custom lists.

Injection

GK_TABS and GkTabsContext are exported for advanced composition.

Tokens

TokenPurpose
--gk-tabs-heightTab min height
--gk-tabs-slider-sizeSlider thickness
--gk-tabs-slider-colorSlider / accent line
--gk-tabs-inset-paddingInset horizontal padding
--gk-tabs-inset-radiusInset corner radius
--gk-tabs-bg-colorTab strip background
--gk-tabs-colorSelected tab label color

Examples

Basic

vue
<script setup lang="ts">
import { ref } from 'vue'
import { GkTabs } from 'god-kit/vue'

const tab = ref('one')
</script>

<template>
  <GkTabs v-model="tab" :items="['one', 'two']" grow>
    <template #item="{ item }">Content for {{ item }}</template>
  </GkTabs>
</template>

Advanced

vue
<GkTabs
  v-model="tab"
  :items="items"
  direction="vertical"
  show-arrows
  inset
  spaced
/>

Edge case

vue
<GkTabs
  v-model="tab"
  :items="[
    { text: 'Summary', value: 'summary' },
    { text: 'Billing', value: 'billing', disabled: true },
    { text: 'Security', value: 'security' },
  ]"
/>

Accessibility notes

  • Arrow keys move focus according to orientation; Home/End jump to first/last enabled tab.
  • Disabled tabs are skipped by roving focus behavior.
  • Keep tab labels concise and pair each tab with meaningful panel content.

Out of scope (v1)

Vuetify VSlideGroup overflow measurement, VWindow touch / continuous scroll, global provideDefaults theming, and density tokens parity.

Released under the MIT License.