Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/content/docs/components/tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ The indicator that highlights the current active tab.
cssVariable: '--reka-tabs-indicator-size',
description: 'The size of the indicator.',
},
{
cssVariable: '--reka-tabs-indicator-thickness',
description: 'The thickness of the indicator.',
},
{
cssVariable: '--reka-tabs-indicator-position',
description: 'The position of the indicator',
Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/Tabs/TabsIndicator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ useForwardExpose()

interface IndicatorStyle {
size: number | null
thickness: number | null
position: number | null
}
const indicatorStyle = ref<IndicatorStyle>({
size: null,
thickness: null,
position: null,
})
const tabs = ref<Array<HTMLElement>>([])
Expand All @@ -47,12 +49,14 @@ function updateIndicatorStyle() {
if (context.orientation.value === 'horizontal') {
indicatorStyle.value = {
size: activeTab.offsetWidth,
thickness: activeTab.offsetHeight,
position: activeTab.offsetLeft,
}
}
else {
indicatorStyle.value = {
size: activeTab.offsetHeight,
thickness: activeTab.offsetWidth,
position: activeTab.offsetTop,
}
}
Expand All @@ -65,6 +69,7 @@ function updateIndicatorStyle() {
v-bind="props"
:style="{
'--reka-tabs-indicator-size': `${indicatorStyle.size}px`,
'--reka-tabs-indicator-thickness': `${indicatorStyle.thickness}px`,
'--reka-tabs-indicator-position': `${indicatorStyle.position}px`,
}"
>
Expand Down
Loading