Tabs

Tabs with overflow collapse, editable items, context menus, and borderless visual variants.

Tabs

Tabs uses semantic tablist / tab / tabpanel roles with arrow, Home, and End keyboard navigation. Every visual mode uses spacing, surface depth, and shadow instead of visible borders.

Choose one render-mode: all mounts every pane immediately, lazy mounts visited panes and keeps them, and active-only unmounts a pane when it becomes inactive. Use active-only for expensive panes when retaining every visited subtree would consume too much memory; state that must survive belongs outside the pane.

The former lazy, destroy-on-hide, and force-render props remain compatibility aliases. Explicit render-mode wins; if both parent aliases are true, destroy-on-hide wins as before.

Render modes

Switch modes and tabs to compare how many pane subtrees are mounted. all keeps every pane, lazy grows as panes are visited, and active-only keeps one pane at a time. The example disables animation so the mount count updates without a leaving pane’s brief transition overlap.

Pane override

Set render-mode on one s-tab when its state should be retained while the parent uses active-only for other panes. The mounted count shows that the draft pane remains in the DOM while the active pane changes.

Style and layout

Switch line, pill, card, position, size, and panel motion in one example.

Overflow collapse

The default overflow="collapse" keeps the active tab visible and moves tabs that do not fit into a More popover. This example uses a narrow container to show the collapse behavior.

Add and remove

editable enables mutation requests for any visual type while application state remains the single source of truth. editable-card keeps its original editable card behavior for compatibility.

Context menu

Use the s-tab label slot with SContextMenu to add contextual actions to a tab label.

Label suffix

Use label-extra to retain the default title, icon and badge while rendering arbitrary suffix content. Tabs adds no built-in close or clear action here; the close icon below belongs to the example Tag. Clearing the count on an inactive tab does not select or close it. The shared STabs slot takes precedence over a local STab slot.

Drag sorting

Drag a label, or focus it and press Alt+Shift+Arrow. Use stable name and key values to preserve selection and input. The first example reorders its source array from sort events; the second binds the optional order array. Sorting never mounts a second pane. Activate collapsed tabs first to reorder them with the keyboard.

Indicator

Set defaults with SConfigProvider tabs; explicit component props take precedence. Installation also supports app.use(SaxDesignVue, { tabs: { showIndicator: true, indicatorPosition: 'top' } }).

API

PROPS

Property
Type
Values
Description
default
Example
More
v-model
String | Number
s-tab name or source index when name is omitted
Active tab value.
0
—
sortable
Boolean
—
Allow label dragging or Alt+Shift+Arrow sorting. Disabled tabs cannot be dragged or used as drop targets.
false
v-model:order
[]
—
Optional controlled order. An internal order is maintained when omitted. Unknown and duplicate values are ignored; unlisted tabs append in source order.
—
type
String
line / pill / card / connected-card / editable-card
Navigation style. connected-card joins the active tab and its pane into one continuous surface; editable-card is the backward-compatible editable card preset.
line
—
show-indicator
Boolean
—
Show the active indicator in line mode. Supports global tabs configuration.
true
indicator-position
'top' | 'bottom' | 'left' | 'right'
top / bottom / left / right
Use top/bottom horizontally and left/right vertically. Omitted or incompatible edges face the content. Supports global tabs configuration.
—
overflow
String
collapse / scroll / wrap
Collapse, scroll, or wrap tabs when horizontal space runs out.
collapse
—
alignment
String
left / center / right / fixed
Tab alignment or equal-width layout.
left
—
position
String
top / bottom / left / right
Tab bar position.
top
—
size
String
small / medium / large
Tab size.
medium
—
animated
Boolean
true / false
Animate panel and navigation changes.
true
—
render-mode
'all' | 'lazy' | 'active-only'
all | lazy | active-only
Mount all panes, retain visited panes, or keep only the active pane mounted.
all
destroy-on-hide
Boolean
true / false
Deprecated compatibility alias for render-mode="active-only". An explicit render-mode wins.
false
lazy
Boolean
true / false
Deprecated compatibility alias for render-mode="lazy". An explicit render-mode wins.
false
editable
Boolean
true / false
Show add and close controls independently from the selected visual type.
false
—
hide-add
Boolean
true / false
Hide the add action when editing controls are enabled.
false
—
color
String
primary | success | danger | warn | warning | dark | text | light | secondary | RGB | RGBA | HEX | HSL | HSLA
Active color.
primary
—
aria-label
String
text
Accessible navigation name. Defaults to the component locale.
Tabs
—

CHILD PROPS

Property
Type
Values
Description
default
Example
More
name
String | Number
unique value
Stable s-tab identity and v-model value.
current index
—
label
String
text
Tab title and overflow-menu fallback text.
Label
—
icon
String
icon name
Optional tab icon and badge.
—
—
badge
String | Number
badge content
Optional tab icon and badge.
—
—
disabled
Boolean
true
Disable a tab or allow closing it when editing controls are enabled.
false
—
closable
Boolean
false
Disable a tab or allow closing it when editing controls are enabled.
true
—
render-mode
'all' | 'lazy' | 'active-only'
all | lazy | active-only
Override the parent mounting policy for this pane.
—
force-render
Boolean
true / false
Deprecated compatibility alias for this pane's render-mode="all". An explicit pane render-mode wins.
false

EVENTS

Event
Type
Description
default
Example
More
sort
(order: [], detail: ) => void
Emits the complete order and value, oldIndex, newIndex after sorting. Usually handle this event to reorder the source array without binding order. Sorting does not change the active value.
—
change
—
Emits value and pane when the active tab changes.
—
—
tab-click
—
Emits value, event, and pane when a tab is activated.
—
—
add
—
Requests editable tab mutations; the parent still owns the array.
—
—
remove
—
Requests editable tab mutations; the parent still owns the array.
—
—
edit
—
Requests editable tab mutations; the parent still owns the array.
—
—
tab-contextmenu
—
Emits value, event, and pane for a tab context-menu event.
—
—

SLOTS

Slot
Scope
Description
default
Example
More
label
{ pane: ; active: boolean; value: }
Customizes every label with pane, active, and value.
—
—
s-tab#label
—
Customizes one label and can compose ContextMenu.
—
—
label-extra
{ pane: ; active: boolean; value: }
Append content after the default label and badge, before the pane close action. Scope supplies pane, active and value. Content is arbitrary; interaction events are stopped at the slot boundary without preventing native defaults.
—
—
s-tab#label-extra
{ pane: ; active: boolean; value: }
Append content after the default label and badge, before the pane close action. Scope supplies pane, active and value. Content is arbitrary; interaction events are stopped at the slot boundary without preventing native defaults.
—
—
extra
—
Trailing tab-bar actions.
—
—
add-icon
—
Replaces editable and overflow icons.
—
—
close-icon
{ pane: }
Replaces editable and overflow icons.
—
—
more-icon
—
Replaces editable and overflow icons.
—
—
Last Updated: 2026-10-28, 06:17:56 UTC
Copied