js-components-container-tab-bar.md 1.5 KB
Newer Older
E
ester.zhou 已提交
1
# tab-bar
Z
zengyawen 已提交
2

E
ester.zhou 已提交
3 4 5
>  **NOTE**
>
>  This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
Z
zengyawen 已提交
6

E
ester.zhou 已提交
7 8 9
**\<tab-bar>** is a child component of **[\<tabs>](js-components-container-tabs.md)** and is used to provide the area to display tab labels. Its child components are horizontally arranged.

## Required Permissions
Z
zengyawen 已提交
10 11 12

None

E
ester.zhou 已提交
13 14

## Child Components
Z
zengyawen 已提交
15 16 17 18

Supported


E
ester.zhou 已提交
19 20 21 22 23 24 25 26 27 28
## Attributes

In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.

| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| mode | string | scrollable | No| Extensibility of the component width. Available values are as follows:<br>- **scrollable**: The width of a child component is the configured width. When the total width of all child components (including the margins) is greater than the tab-bar width, the child components can scroll horizontally.<br>- **fixed**: The width of a child component equals the tab-bar width divided by the number of child components.|


## Styles
Z
zengyawen 已提交
29

E
ester.zhou 已提交
30
The [universal styles](../arkui-js/js-components-common-styles.md) are supported.
Z
zengyawen 已提交
31 32


E
ester.zhou 已提交
33
## Events
Z
zengyawen 已提交
34

E
ester.zhou 已提交
35
The [universal events](../arkui-js/js-components-common-events.md) are supported.
Z
zengyawen 已提交
36 37


E
ester.zhou 已提交
38
## Methods
Z
zengyawen 已提交
39

E
ester.zhou 已提交
40
The [universal methods](../arkui-js/js-components-common-methods.md) are supported.
Z
zengyawen 已提交
41 42


E
ester.zhou 已提交
43
## Example
Z
zengyawen 已提交
44

E
ester.zhou 已提交
45
For details, see [Example in tabs](../arkui-js/js-components-container-tabs.md#example).