---
title: TabBar 标签栏
description: 用于在不同功能模块之间进行快速切换,位于页面底部。
spline: navigation
isComponent: true
---
## 引入
全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
```json
"usingComponents": {
"t-tab-bar": "tdesign-miniprogram/tab-bar/tab-bar",
"t-tab-bar-item": "tdesign-miniprogram/tab-bar-item/tab-bar-item"
}
```
## 代码演示
在开发者工具中预览效果
### 组件类型 #### 纯文本标签栏 {{ text-only }} #### 图标加文字标签栏 {{ base }} #### 纯图标标签栏 {{ icon-only }} #### 双层级纯文本标签栏 {{ sub }} ### 组件样式 #### 弱选中标签栏 {{ badge }} #### 悬浮胶囊标签栏 {{ round }} #### 自定义主题 {{ custom }} ## API ### TabBar Props 名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- style | Object | - | 样式 | N custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N bordered | Boolean | true | 是否显示外边框 | N fixed | Boolean | true | 是否固定在底部 | N safe-area-inset-bottom | Boolean | true | 是否为 iPhoneX 留出底部安全距离 | N shape | String | normal | 标签栏的形状。可选项:normal/round | N split | Boolean | true | 是否需要分割线 | N theme | String | normal | 选项风格。可选项:normal/tag | N value | String / Number / Array | - | 当前选中标签的索引。TS 类型:`string \| number \| ArrayTips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"