2024-12-04 15:06:34 +00:00
< script setup lang = "ts" >
import Input from '~/components/ui/Input.vue'
import Tabs from '~/components/ui/Tabs.vue'
import Tab from '~/components/ui/Tab.vue'
< / script >
2024-11-26 11:59:11 +00:00
# Tabs
Tabs are used to hide information until a user chooses to see it. You can use tabs to show two sets of information on the same page without the user needing to navigate away.
| Prop | Data type | Required? | Description |
| ------- | --------- | --------- | -------------------- |
| `title` | String | Yes | The title of the tab |
## Tabbed elements
::: warning
2024-12-04 15:06:34 +00:00
The `<Tab>` component must be nested inside a `<Tabs>` component.
2024-11-26 11:59:11 +00:00
:::
```vue-html
2024-12-04 15:06:34 +00:00
< Tabs >
< Tab title = "Overview" > Overview content< / Tab >
< Tab title = "Activity" > Activity content< / Tab >
< / Tabs >
2024-11-26 11:59:11 +00:00
```
2024-12-04 15:06:34 +00:00
< Tabs >
< Tab title = "Overview" > Overview content< / Tab >
< Tab title = "Activity" > Activity content< / Tab >
< / Tabs >
2024-11-26 11:59:11 +00:00
::: info
If you add the same tab multiple times, the tab is rendered once with the combined content from the duplicates.
:::
```vue-html{2,4}
2024-12-04 15:06:34 +00:00
< Tabs >
< Tab title = "Overview" > Overview content< / Tab >
< Tab title = "Activity" > Activity content< / Tab >
< Tab title = "Overview" > More overview content< / Tab >
< / Tabs >
2024-11-26 11:59:11 +00:00
```
2024-12-04 15:06:34 +00:00
< Tabs >
< Tab title = "Overview" > Overview content< / Tab >
< Tab title = "Activity" > Activity content< / Tab >
< Tab title = "Overview" > More overview content< / Tab >
< / Tabs >
2024-11-26 11:59:11 +00:00
## Tabs-right slot
You can add a template to the right side of the tabs using the `#tabs-right` directive.
```vue-html{5-7}
2024-12-04 15:06:34 +00:00
< Tabs >
< Tab title = "Overview" > Overview content< / Tab >
< Tab title = "Activity" > Activity content< / Tab >
2024-11-26 11:59:11 +00:00
< template #tabs -right >
2024-12-04 15:06:34 +00:00
< Input icon = "bi-search" placeholder = "Search" / >
2024-11-26 11:59:11 +00:00
< / template >
2024-12-04 15:06:34 +00:00
< / Tabs >
2024-11-26 11:59:11 +00:00
```
2024-12-04 15:06:34 +00:00
< Tabs >
< Tab title = "Overview" > Overview content< / Tab >
< Tab title = "Activity" > Activity content< / Tab >
2024-11-26 11:59:11 +00:00
< template #tabs -right >
2024-12-04 15:06:34 +00:00
< Input icon = "bi-search" placeholder = "Search" / >
2024-11-26 11:59:11 +00:00
< / template >
2024-12-04 15:06:34 +00:00
< / Tabs >