Skip to content
Star

PxTabs

A horizontal tab bar with icon support, active state highlighting, and optional close/remove tab functionality. Renders only tabs with show !== false.

Basic Usage

Demo
Active tab: profile

With Protected (Disabled) Tabs

Protected Tabs

API Reference

PropTypeDefaultDescription
tabsrequired
TabItemConfig[]
modelValuerequired
string
protectedTabs
string[]() => []

Tab Object Shape

ts
interface TabItemConfig {
  key: string            // Unique identifier, used as modelValue
  label: string          // Display text
  icon?: string          // Lucide icon name (e.g. 'User', 'Calendar')
  show?: boolean         // Hide tab entirely when false (default: true)
  enabled?: boolean      // Used with protectedTabs to disable a tab
  tooltip?: string       // Optional tooltip on hover
  removeTab?: boolean    // Show ✕ button to close the tab
  command?: () => void   // Custom function to run on click (skips tab switching)
}

Built with VitePress