Layout and Overlays
Blocks which lay out a page, and tooltips, menus and dialogs which open over it. Import the components from @/afcl, see AdminForth Components Library.
VerticalTabs
Wrap each tab lable in tamplate with v-slot value tab:TAB_ALIAS. Wrap each tab content in tamplate with v-slot value TAB_ALIAS. TAB_ALIAS is a unique identifier for each tab here. Place all templates inside VerticalTabs component.
import { VerticalTabs } from '@/afcl'
import { IconCircleUser, IconLayoutGrid } from '@iconify-prerendered/vue-lucide'
<VerticalTabs>
<template #tab:Profile>
<IconCircleUser class="w-4 h-4" />
Profile
</template>
<template #tab:Dashboard>
<IconLayoutGrid class="w-4 h-4" />
Board
</template>
<template #Profile>
<h3 class="text-base font-semibold mb-2">Profile Tab</h3>
<p>This is some placeholder content the Profile tab's associated content</p>
</template>
<template #Dashboard>
Dashboard Tab Content
</template>
</VerticalTabs>
In a card
tabsClass and contentClass add classes to the column of tabs and to the content, they override the default ones (the margins and the frame of the column). The tabs-header slot goes above the tabs. This is how the settings page puts its tabs on a tinted pane of a card:
import { VerticalTabs } from '@/afcl'
import { IconLink, IconMonitorSmartphone } from '@iconify-prerendered/vue-lucide'
<VerticalTabs
class="overflow-hidden rounded-xl border border-lightCardBorder bg-lightCardBackground dark:border-darkCardBorder dark:bg-darkCardBackground"
tabsClass="m-0 md:m-0 md:self-stretch md:w-64 shrink-0 px-3 py-4 rounded-none border-0 border-b md:border-b-0 md:border-e border-lightCardBorder dark:border-darkCardBorder bg-lightVerticalTabsBackground dark:bg-darkVerticalTabsBackground"
contentClass="p-5 md:ps-6"
>
<template #tabs-header>
<p class="px-2.5 pb-3 font-semibold text-lightCardTitle dark:text-darkCardTitle">Settings</p>
</template>
<template #tab:accounts>
<IconLink class="w-4 h-4" />
Connected accounts
</template>
<template #tab:sessions>
<IconMonitorSmartphone class="w-4 h-4" />
Active sessions
</template>
<template #accounts>
Connected accounts content
</template>
<template #sessions>
Active sessions content
</template>
</VerticalTabs>