Divide data collections which are related yet belong to different types.
<stylelang="scss">
:not(.el-tabs--border-card) > .el-tabs__content {
padding: 32px;
background-color: #F4F5F7;
color: #6B778C;
font-size: 32px;
font-weight: 600;
}
.el-tabs--right, .el-tabs--left {
.el-tabs__content {
height: 100%;
}
}
</style>
## Basic usage
Basic and concise tabs.
:::demo 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.
tabs/basic
:::
## Card Style
Tabs styled as cards.
:::demo Set `type` to `card` can get a card-styled tab.
tabs/card-style
:::
## Border card
Border card tabs.
:::demo Set `type` to `border-card`.
tabs/border-card
:::
## Tab position
You can use `tab-position` attribute to set the tab's position.
:::demo You can choose from four directions: `tabPosition="left|right|top|bottom"`
tabs/tab-position
:::
## Custom Tab
You can use named slot to customize the tab label content.
| editable | whether Tab is addable and closable | boolean | — | false |
| tab-position | position of tabs | string | top/right/bottom/left | top |
| stretch | whether width of tab automatically fits its container | boolean | - | false |
| before-leave | hook function before switching tab. If `false` is returned or a `Promise` is returned and then is rejected, switching will be prevented | Function(activeName, oldActiveName) | — | — |
| name | identifier corresponding to the name of Tabs, representing the alias of the tab-pane | string | — | ordinal number of the tab-pane in the sequence, e.g. the first tab-pane is '1' |