Navigation

Tabs

Switch between views in the same context. One indicator glides between tabs; the content simply changes.

Everything at a glance: status, domains and recent activity.

Installation #

With the Nuxt module, every component is auto-imported — there is nothing to add. In a plain Vue project, import what you use:

Copy
import { JTabs } from '@juxtui/ui'

Usage #

Copy
<JTabs v-model="tab" :items="[
  { value: 'overview', label: 'Overview' },
  { value: 'activity', label: 'Activity' },
]">
  <template #overview>…</template>
  <template #activity>…</template>
</JTabs>

Variants & examples #

Pill#

A segmented control for compact view switches.

Copy
<script setup lang="ts">
const range = ref('7d')

const ranges = [
  { value: '24h', label: '24h' },
  { value: '7d', label: '7 days' },
  { value: '30d', label: '30 days' },
  { value: '90d', label: '90 days' },
]
</script>

<template>
  <JTabs v-model="range" variant="pill" size="sm" label="Time range" :items="ranges" />
</template>

Disabled tabs#

Name, avatar and default region.

API #

Props

PropTypeDefault Description
modelValuestring—The selected tab’s value. Defaults to the first enabled tab.
itemsArray<{ value, label, disabled? }>—The tabs.
variant'line' | 'pill''line'Underline for sections, pill for view switches.
size'sm' | 'md''md'Tab height.
fillbooleanfalseStretch tabs to fill the width.
labelstring—Accessible name of the tab list.

Events

EventPayload Description
update:modelValuestringEmitted when a tab is selected.

Slots

SlotProps Description
[value]{ item, selected }One slot per tab, named after its value, for the panel.
tab{ item, selected }Custom tab label.

Accessibility #

  • Implements the WAI-ARIA tabs pattern with a roving tabindex and automatic activation.
  • Each panel is labelled by its tab and linked with aria-controls.
  • The indicator animates only on deliberate changes — never on resize — and not at all under reduced motion.

Keyboard #

Key Action
←→Select the previous or next tab, skipping disabled ones.
HomeEndSelect the first or last tab.
TabMove focus from the tab list into the panel.