Tabs

Divide data collections which are related yet belong to different types.

Basic usage

Tabs provide a selective card functionality. By default the first tab is selected as active, and you can activate any tab by setting the value attribute.

Separator style

Set type to separator can get a separator styled tabs.

Tab Position

You can use tab-position attribute to set the tab's position.

Tab Alignment

Tab nav can be center align or stretch to full width.

Custom Tab

You can use named slot to customize the tab label content.

Tabs Attributes

AttributeDescriptionTypeAccepted ValuesDefault
model-value / v-modelbinding value, name of the selected tabstring / numbername of first tab
typetype of Tabstringseparator
closablewhether Tab is closablebooleanfalse
addablewhether Tab is addablebooleanfalse
editablewhether Tab is addable and closablebooleanfalse
tab-positionposition of tabsstringtop / right / bottom / lefttop
stretchwhether width of tab automatically fits its containerboolean-false
before-leavehook function before switching tab. If false is returned or a Promise is returned and then is rejected, switching will be preventedFunction(activeName, oldActiveName)

Tabs Events

Event NameDescriptionParameters
tab-clicktriggers when a tab is clicked(pane: TabsPaneContext, ev: Event)
tab-changetriggers when activeName is changed(name: TabPanelName)
tab-removetriggers when tab-remove button is clicked(name: TabPanelName)
tab-addtriggers when tab-add button is clicked
edittriggers when tab-add button or tab-remove is clicked(paneName: TabPanelName | undefined, action: 'remove' | 'add')

Tabs Slots

NameDescriptionSubtags
-customize default contentTab-pane

Tab-pane Attributes

AttributeDescriptionTypeAccepted ValuesDefault
labeltitle of the tabstring
disabledwhether Tab is disabledbooleanfalse
nameidentifier corresponding to the name of Tabs, representing the alias of the tab-panestring / numberordinal number of the tab-pane in the sequence, e.g. the first tab-pane is '0'
closablewhether Tab is closablebooleanfalse
lazywhether Tab is lazily renderedbooleanfalse

Tab-pane Slots

NameDescription
-Tab-pane's content
labelTab-pane's label
Last Updated:
Contributors: Tam Mai