WARNING
While the documentation is fairly complete, it is still in first draft.
Tabs (BonesTabs)
Overview
The Barebones Tabs component is an accessible keyboard compatible tabbing component.
Component parts
| Part name | Description |
|---|---|
| component | The components root element. |
| navigation | The nav element for the tab buttons |
| navigationList | The ul wrapper that sits inside the navigation element |
| navigationListItem | The li wrapper for individual tab buttons |
| navigationButtonActive | The tab button when is the current active tab |
| navigationButton | The tab button when not the current active tab |
| contentItems | The element that wraps all of the content items |
| contentItem | The element that wraps the tabs content slot |
| Prop name | Description |
|---|---|
| tabs | tabs accepts an array of the type Tab, see types. |
| renderInactiveTabs | renderInactiveTabs allows you to render inactive tabs in the DOM, by default this is set to true, if you'd like inactive tabs hidden in the DOM you can set this to false. |
Slots
| Slot name | Description |
|---|---|
| Wildcard* | The wildcard slot is the content of a tab it's name should match a key in the tabs prop array |
Prop Types
export interface Tab {
key: string;
title: string;
}
Component Type
export interface Tabs {
parts: Parts;
}
Examples
WARNING
Examples use tailwind/salient theme, to use this theme you may add it using the theme npx command and installing Tailwind JIT in your application. Read more about themes.
Code
<BonesTabs
:tabs="[
{
key: 'bronx-tale',
title: 'Bronx Tale',
},
{
key: 'goodfellas',
title: 'Goodfellas',
},
]"
>
<template #bronxTale> The Bronx...</template>
<template #goodfellas>The story of Irish-Italian...</template>
</BonesTabs>
Barebones Components