# tabs The **** component provides a tab container. ## Permission List None ## Child Component A **** can wrap at most one **<[tab-bar](js-components-container-tab-bar.md)\>** and at most one **<[tab-content](js-components-container-tab-content.md)\>**. ## Attribute In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported.

Name

Type

Default Value

Mandatory

Description

index

number

0

No

Index of the active tab.

vertical

boolean

false

No

Whether the tab is vertical. Available values are as follows:

  • false: The <tab-bar> and <tab-content> are arranged vertically.
  • true: The <tab-bar> and <tab-content> are arranged horizontally.
## Style Styles in [Universal Styles](js-components-common-styles.md) are supported. ## Event In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported.

Name

Parameter

Description

change

{ index: indexValue }

Triggered upon tab switching.

NOTE:

This event is not triggered when the index value is dynamically changed.

## Example Code ```
Home Index Detail
First screen
Second screen
Third screen
``` ``` /* xxx.css */ .container { flex-direction: column; justify-content: flex-start; align-items: center; } .tabs { width: 100%; } .tabcontent { width: 100%; height: 80%; justify-content: center; } .item-content { height: 100%; justify-content: center; } .item-title { font-size: 60px; } .tab-bar { margin: 10px; height: 60px; border-color: #007dff; border-width: 1px; } .tab-text { width: 300px; text-align: center; } ``` ``` // xxx.js export default { change: function(e) { console.log("Tab index: " + e.index); }, } ``` ![](figures/tab.gif)