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 Examples ​

Items (basic)

Data-driven tabs with string items and a scoped #item panel slot.

Slots (GkTab + window)

Declare GkTab buttons and pair panels with GkTabsWindowItem in the #window slot.

Best practice: Disabled tabs are skipped by keyboard navigation; keep panel content in sync with enabled values.

Items with disabled entries

Use object items when you need per-tab disabled or display text.

Vertical strip with arrows

Vertical direction with scroll arrows, inset padding, and spaced tab buttons.

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
colorstring—Sets --gk-tabs-color for the selected tab
bgColorstring—Sets --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 | string—Sets --gk-tabs-height (numbers become px)
hideSliderbooleanfalseHides the underline slider
insetbooleanfalseInset padding/radius on the tab strip
insetPaddingnumber | string—Overrides --gk-tabs-inset-padding when inset
insetRadiusnumber | string—Overrides --gk-tabs-inset-radius when inset
sliderColorstring—Sets --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
default—GkTab 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
window—Extra panels when using slot-based tabs
prev—Left scroll control when showArrows
next—Right scroll control when showArrows

Events ​

EventPayload
update:modelValuestring | number | undefined

GkTab ​

PropTypeDefaultDescription
valuestring | numberrequiredTab id
disabledbooleanfalse
textstring—Default 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 ​

Each scenario under Live Examples includes a copyable Vue snippet (source is imported from the same SFC as the preview).

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.