Registry / web-framework / vue-nav-tabs

vue-nav-tabs

JSON →
library0.5.7jsnpmunverified

Vue-tabs is a Vue.js-based tab component designed to simplify the creation and customization of tabbed interfaces in web applications. It provides a flexible way to organize content into distinct, navigable sections. The current stable version is 0.5.7, indicating it's still in a pre-1.0 development phase, which suggests a potentially less rigid release cadence and a focus on feature additions and bug fixes rather than strict semantic versioning for breaking changes. Key differentiators include its built-in theming support (default Bootstrap, Paper, Material), full support for dynamic tab rendering (adding/removing tabs programmatically), and `v-model` support for programmatic tab switching. It also boasts good accessibility features with ARIA tab interface specifications and supports asynchronous validation functions for tab changes. The library aims for ease of use and customization, offering various demos for different layouts like vertical tabs, icons, and animations.

npm install vue-nav-tabs
INSTALL
IMPORT
SIG · VUE-NAV-TABS
V
vue-nav-tabs
web-frameworkjavascriptv0.5.7
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VueTabs
import { VueTabs, VTab } from 'vue-nav-tabs'
import VueTabs from 'vue-nav-tabs'; // Incorrect default import const { VueTabs } = require('vue-nav-tabs'); // CommonJS import for ESM-first library
Vue-tabs primarily uses named exports for its components. Ensure Vue is globally available or imported if not using a build step.
VTab
import { VTab } from 'vue-nav-tabs'
VTab is the individual tab component used as a child within VueTabs.
Vue
import Vue from 'vue'
While not directly from 'vue-nav-tabs', Vue is a peer dependency and must be imported and used to register the components globally, or used within a component setup.

This quickstart demonstrates how to set up `vue-nav-tabs` in a Vue 3 application, including dynamic tab management and programmatic tab switching with `v-model`.

import { createApp } from 'vue'; import { VueTabs, VTab } from 'vue-nav-tabs'; // Import one of the themes, e.g., 'material' import 'vue-nav-tabs/themes/material.css'; const app = createApp({ data() { return { currentTab: 'First Tab', tabs: [ { name: 'First Tab', content: 'Content for the first tab.' }, { name: 'Second Tab', content: 'Content for the second tab.' }, { name: 'Third Tab', content: 'Content for the third tab.' } ] }; }, template: ` <div> <vue-tabs v-model="currentTab"> <v-tab v-for="tab in tabs" :key="tab.name" :title="tab.name"> {{ tab.content }} </v-tab> </vue-tabs> <button @click="addTab">Add Tab</button> <button @click="removeTab">Remove Last Tab</button> </div> `, methods: { addTab() { const newTabIndex = this.tabs.length + 1; this.tabs.push({ name: `Tab ${newTabIndex}`, content: `Dynamic content for Tab ${newTabIndex}.` }); }, removeTab() { if (this.tabs.length > 0) { this.tabs.pop(); } } } }); app.component('VueTabs', VueTabs); app.component('VTab', VTab); app.mount('#app');
Debug
Known issues
breakingThe library underwent a rewrite in v0.5.0 with JSX for better modularity and full support for dynamic tab rendering. This likely introduced breaking changes for consumers directly interacting with internal component structures or relying on previous rendering mechanisms. Additionally, `v-model` support was introduced at this version.
fix
Review the v0.5.0 release notes and update component usage to align with the new JSX-based rendering and `v-model` patterns. Refer to the updated documentation and demos for correct usage.
affects: >=0.5.0
gotchaThe package is still in a pre-1.0 state (current version 0.5.7), meaning that breaking changes might occur more frequently between minor versions without strict adherence to semantic versioning. Developers should review release notes for each update.
fix
Always check release notes before updating minor versions. Consider pinning to a specific patch version or thoroughly testing updates in a development environment.
affects: >=0.x.x
gotchaThemes are not automatically included and must be explicitly imported. If a theme is not imported, the tabs will lack styling and appear as basic HTML elements.
fix
Import your desired theme (e.g., `import 'vue-nav-tabs/themes/material.css';`) in your main application file or component where `VueTabs` is used.
affects: >=0.5.0
gotchaWhen using dynamic tabs and removing the active tab, there was a fix for an error in v0.5.5. Users on older versions might encounter issues where removing an active tab leads to an error or unexpected behavior.
fix
Update to version 0.5.5 or later to resolve issues related to removing the active tab dynamically.
affects: <0.5.5
gotchaThe `tabData` property was added in v0.5.7, allowing additional data to be passed to the tab title. Code relying on this feature will not work on older versions.
fix
Ensure you are on version 0.5.7 or higher if you intend to use the `tabData` property for tab titles.
affects: <0.5.7
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'title')
Attempting to access a property on an undefined tab object, possibly due to issues with dynamic tab rendering or incorrect data binding.
fix
Verify that your `tabs` array or object is correctly populated and that `v-for` iterations have valid data. Ensure `key` bindings are unique for dynamic tabs.
Module not found: Error: Can't resolve 'vue-nav-tabs/themes/...' in '...'
Incorrect path or missing import for a CSS theme file. The theme files are located in the `themes` directory within the package.
fix
Double-check the import path for your chosen theme (e.g., `import 'vue-nav-tabs/themes/default.css';`). Ensure the package is correctly installed and accessible.
[Vue warn]: Failed to resolve component: vue-tabs
The `VueTabs` or `VTab` component has not been correctly registered with the Vue application or component.
fix
Ensure you are either globally registering the components (`app.component('VueTabs', VueTabs);`) or importing and registering them locally within the `components` option of your Vue component.
Upgrade
Version history
0.5.7latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources