diff --git a/apps/playground/src/ScrollTabsLab.vue b/apps/playground/src/ScrollTabsLab.vue
new file mode 100644
index 0000000..3fcd42b
--- /dev/null
+++ b/apps/playground/src/ScrollTabsLab.vue
@@ -0,0 +1,57 @@
+
+
+
+ ScrollShadow / Tabs 集成回归
+
+
+
+
+
+
+
+
+
+
+ {{ key }}
+
+
+
+
+
+ {{ key }} 内容
+
+
+
+ 段落 {{ i }}
+
+
+
diff --git a/docs/compatibility.md b/docs/compatibility.md
index e6c738f..28b8eb4 100644
--- a/docs/compatibility.md
+++ b/docs/compatibility.md
@@ -38,7 +38,7 @@
| kbd | 验证中(最小实现) | variant;KbdAbbr keyValue 映射与 title;KbdContent;上下文类名;导出 kbdKeysMap/LabelMap |
| link | 验证中(最小实现) | 原生 a + LinkIcon;isDisabled/asChild/焦点与 data 状态;默认图标为基线 ExternalLinkIcon;onPress 由 click 适配 |
| popover | 验证中(OVERLAY-02) | Root/Trigger/Content/Dialog/Heading/Arrow;6/6 基线例;逻辑定位/碰撞/退出/标题;模态 closeAutoFocus 不支持取消恢复,见 OVERLAY-02 |
-| scroll-shadow | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| scroll-shadow | 验证中(M24) | 7/7 基线例;fade/方向/尺寸/偏移/受控可见性;VueUse 测量与公开 useScrollShadow,RTL/动态内容;CSS scroll timeline 保留 |
| separator | 验证中(最小实现) | orientation/variant/decorative;默认 hr + role=separator;asChild 自定义根;Reka Separator |
| skeleton | 验证中(最小实现) | shimmer/pulse/none、--skeleton-animation 全局默认、父级单次 shimmer;挂载后改 CSS 变量不自动更新 |
| spinner | 验证中(最小实现) | size/color 变体、role=status、内置渐变 SVG;嵌入 Button 保持 16px;reduced-motion 支持 |
@@ -47,7 +47,7 @@
| toggle-button | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
| switch | 验证中(最小实现) | 根字段与组合部件、3 尺寸、ARIA 透传、原生/ARIA 校验、FormData/reset;PressEvent 不等价 |
| switch-group | 验证中(布局) | vertical/horizontal;不共享选择值,已移植基线 CSS |
-| tabs | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| tabs | 验证中(M25) | 七部件、10/10 基线例;primary/secondary、方向/对齐、受控/键盘/禁用/滚动/指示器;Vue 模型与 ID/集合差异见报告 |
| tag | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
| tag-group | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
| toggle-button-group | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
@@ -190,3 +190,7 @@ React render 自定义根类型不支持;原生 attrs/具名部件/作用域
## Modal / Popover / Tooltip(OVERLAY-02)
公共部件、源 CSS/tv、中文文档、14 + 6 + 6 个基线演示与类型/行为回归已迁移;详情见 [OVERLAY-02 报告](./migrations/OVERLAY-02-modal-popover-tooltip.md)。框架适配采用 Vue 具名组件、v-model:open、as/asChild、原生事件与作用域插槽;不承诺 React PressEvent。Popover 模态 closeAutoFocus 继承 Reka 无条件恢复触发器的策略,取消恢复需非模态模式;Tooltip warmup 由 ConfigProvider 范围共享,非 RAC 全局调度。SSR Portal 挂载后插入。未声明逐像素、全部读屏/触屏/RTL、Nuxt 或独立打包安装验收。
+
+## M24–M25 ScrollShadow / Tabs(2026-10-23)
+
+7/7 与 10/10 固定基线预览已迁移。复用 VueUse 观察和 Reka Tabs,未引入集合/滚动/焦点的第二套全局协议。公开 useScrollShadow 返回只读状态/属性供 Vue 绑定;Tabs 使用具名部件、v-model、作用域插槽和实例唯一 ID。失活面板保留隐藏容器而卸载内容,shouldForceMount 可保留内容。RAC render 集合、Next Link、私有自动 ID/SelectionIndicator 机制采用 Vue 方式替代;具体行为和未验收边界见 [M24–M25 报告](./migrations/M24-M25-scroll-shadow-tabs.md)。
diff --git a/docs/migration-handoff.md b/docs/migration-handoff.md
index 3f51fe2..4e3c9c0 100644
--- a/docs/migration-handoff.md
+++ b/docs/migration-handoff.md
@@ -238,3 +238,7 @@ overlay 私有实现、useOverlayState 与 ConfigProvider 由集成人维护;
## OVERLAY-02 集成完成后的边界
Modal / Popover / Tooltip 公共迁移与全部 26 个基线预览已接入,差异和验证见 [OVERLAY-02](./migrations/OVERLAY-02-modal-popover-tooltip.md)。共享入口、providers/composables、overlay 私有实现与三个家族归集成人;ScrollShadow → Tabs 仍可作为其他 AI 的独立批次,不代表已派发。新弹层/集合任务必须先复用现有协议,并交出焦点/名称/退出/嵌套的失败场景,不能另造全局栈。
+
+## M24–M25 集成完成(2026-10-23)
+
+用户改为由集成人继续实施,ScrollShadow → Tabs 已迁移,不再作为待派发任务。实际交付与差异见 [M24–M25](./migrations/M24-M25-scroll-shadow-tabs.md)。后续集合/菜单任务复用现有弹层、字段与滚动设施;共享入口仍由单一编辑者集成。两个工程组件的 keyboardActivation、data-disabled、ID、指示器测量、ScrollShadow 公共 hook 需保留回归;不能把演示组件数量当作完整兼容验收。
diff --git a/docs/migrations/M24-M25-scroll-shadow-tabs.md b/docs/migrations/M24-M25-scroll-shadow-tabs.md
new file mode 100644
index 0000000..3f6e306
--- /dev/null
+++ b/docs/migrations/M24-M25-scroll-shadow-tabs.md
@@ -0,0 +1,31 @@
+# M24–M25:ScrollShadow / Tabs
+
+2026-10-23;起始提交 2b4ac04(Modal/Popover/Tooltip)。固定 HeroUI 3.2.6 / ce90ea3,由集成人继续迁移;状态为验证中,不声明全兼容或逐像素完成。
+
+## 交付
+
+- ScrollShadow / useScrollShadow:fade、方向、40px 默认尺寸、offset、隐藏滚动条、自动/显式可见性、isEnabled 与 visibilityChange。RAF 合并读数,复用 VueUse 的尺寸/子树/事件观察,资源 load 也触发测量,卸载清理。暴露 element/update/scrollTo。
+- Tabs / TabsListContainer / TabsList / TabsTab / TabsIndicator / TabsPanel / TabsSeparator:两个变体、方向/对齐、v-model 与 selectedKey 别名、默认选择、disabledKeys、automatic/manual 键盘激活、Home/End/方向键、滚动箭头及 250ms 指示器过渡。复用 Reka Tabs/RovingFocus/Presence,兼容逻辑 id 别名,生成实例唯一真实 DOM ID。
+- 完整移植两份 CSS/tv;中文文档、实际导航、全部 7 + 10 个源示例、API/样式说明、复制/高亮共用的 SFC。结构代码另有编译挂载;表格沿公共铺满/换行规则。
+- VueUse 14.4.0 为精确直接依赖并 external,未新增第二套交互库。工程页 ?scroll-tabs 提供 RTL/方向切换、垂直溢出与动态内容回归。
+
+## Vue 差异
+
+- 模型为 modelValue/update:modelValue(v-model),兼容 selectedKey/defaultSelectedKey/@selection-change;默认值仅初始化。未定义受控值时使用本地默认/首个启用项;失去选中成员后回落到首个启用项。字符串与数值身份保留。
+- React 对象子部件和 render-prop 集合改为具名部件、v-for 与作用域插槽;DOM render 改为原生 as 字符串 + attrs。Next Link 示例使用本地指南/组件/介绍页的普通锚点,未加入 Vue Router;保留上游导航型示例不匹配的内容 key。
+- TabsTab/Panel 的 id 是逻辑值别名,不是最终 DOM ID;显式 aria-controls/labelledby 可透传。SSR 静态预规划覆盖已知部件/原生/Fragment,任意未知 Vue 包装内需显式 defaultValue/ARIA,未承诺自动展开全部用户组件。
+- 失活面板容器保留并隐藏,默认卸载其内容,shouldForceMount 保留内容。指示器使用真实布局坐标与 CSS 过渡;未复刻 RAC 的私有 SelectionIndicator 运行时、路由与集合导出。
+- Reka 空 data-disabled 是键盘协议,CSS 存在选择器替代 RAC 的 true 值。保留按下/键盘激活,自动焦点经薄适配去重,受控父级拒绝时一次指针手势只请求一次。click.prevent 不能撤销此前 mousedown 激活;可取消相应 mousedown/keydown。
+- useScrollShadow 接受响应式 ref/getter,返回 readonly visibility、attributes、update;调用者 v-bind 属性,区别于 React hook 隐式写 dataset。显式 visibility 优先于禁用检测,不自动发检测事件。水平 left/right 表示逻辑前后边缘;CSS scroll timeline/首次绘制/堆叠上下文限制原样说明。
+
+## 验证
+
+- pnpm test:24 文件 / 394 项(含独立 node SSR 11 项与 jsdom 实际水合)。pnpm test:unit:23 文件 / 383 项。新批次 13 个行为/全量演示/水合测试,另加 node SSR 1 项。
+- typecheck、build:docs、build:playground、format、git diff --check 通过;文档仅既有 chunk 提醒。源码和 dist 声明正反消费覆盖值类型/变体/事件;临时 dist 探针删除,不算独立安装。
+- 5173 浏览器抽查:Tabs primary 选择与面板、250ms 指示器、secondary 垂直 2px 边线、禁用跳过、横向箭头 clamp 到末端;ScrollShadow 240px 内容容器/遮罩;API 长短表无横向溢出(桌面 736px、390px 窄屏 350px,所有行维持四列,页面 scrollWidth 等于 viewport);最终 console warn/error 为 0。截图 /tmp/heroui-vue-tabs-final.png 为 1280×720 浅色。
+- 5175 ?scroll-tabs:RTL 负向滚动、160px 垂直溢出、内容从 1 → 12 → 1 自动重测并清除阴影。键盘与真实滚动验证,未逐个点击全部演示。
+- 未建立自动逐像素、完整读屏/触屏、全部浏览器 RTL、Nuxt Teleport/水合或打包后独立安装验收。JS 测试尺寸模拟只验证状态边界,不作为真实布局证据。
+
+## 本批发现并关闭的问题
+
+Reka ID 覆盖外层关联、asChild 的未选中面板容器被一并卸载、预规划漏掉 kebab 禁用属性、将 data-disabled 改成 true 破坏方向键过滤、API 表的未转义管道、受控拒绝时重复选择请求、初始空/全禁用时底座误入非受控、禁用后重新启用导致旧选中项复活,均已修复并回归。布局测量保留 offset 坐标,避免祖先缩放引入错误。
diff --git a/docs/upstream.md b/docs/upstream.md
index 7e14496..13132c7 100644
--- a/docs/upstream.md
+++ b/docs/upstream.md
@@ -117,3 +117,11 @@ M18–M20 的标签桥接在 Vue 使用 indicator 注册表与 SSR 直接/原生
- 中文文档与 demos/cn/{modal,popover,tooltip}:14/6/6 个基线预览、介绍/结构/样式/API;模板代码与预览共用 SFC。表单例增加真实 FormData 反馈,框架差异另行说明。
- tw-animate-css 1.4.0(与固定上游一致)提供源样式依赖的动画 utilities,未引入另一套动画运行时;MIT 许可证保存为 third-party/TW-ANIMATE-CSS-LICENSE 和 packages/styles/LICENSE.tw-animate-css。库与文档编译入口均导入,保持独立构建。
- Reka UI 2.11.0 负责 Dialog/Popover/Tooltip/Portal/Presence/FocusScope 的真实运行时。Tooltip 仅适配其现有 tooltip.open 协调事件,不复制全局焦点或关闭栈。具体差异见 OVERLAY-02 报告。
+
+## M24–M25 来源(2026-10-23)
+
+- 固定 HeroUI ce90ea3 的 packages/react/src/components/{scroll-shadow,tabs}:部件/属性、滚动边界(offset 与末端 1px 容差)、RTL 滚动箭头的 80% 步进与 clamp。
+- 同名 CSS/tv 完整移植为 hv- 命名空间;ScrollShadow 关键帧改名避免冲突,CSS 自定义变量保留。Tabs 禁用选择器适配 Reka 的空 data-disabled,不能改动该值破坏底层键盘候选过滤。Apache-2.0 来源头和原许可证保留。
+- CN components/(utilities)/scroll-shadow.mdx 与 (navigation)/tabs.mdx,demos/cn/scroll-shadow(7 例)、tabs(10 例):文案、次序、结构与样式;预览/复制/高亮仍共用 SFC。内置四向 Chevron 路径直接来自固定 icons.tsx,非自绘演示图标。
+- VueUse core 14.4.0(MIT,既有锁文件版本新增为直接依赖),使用 ResizeObserver/MutationObserver/事件工具,库产物 external 并由 dependencies 声明;未复制 VueUse 实现。Reka 2.11.0 的 Tabs/RovingFocus/Presence 保留为交互底座。
+- React SelectionIndicator 改为共享布局测量与各 Tab 的装饰性指示器,保持 250ms ease-out-fluid 的 translate/width/height 过渡。布局坐标避免祖先 Modal 缩放污染测量。React hook 改为 Vue 响应式输入与 attributes 显式绑定。
diff --git a/docs/verification.md b/docs/verification.md
index 30c94f6..17a74ee 100644
--- a/docs/verification.md
+++ b/docs/verification.md
@@ -467,3 +467,14 @@ typecheck、build:docs、build:playground、format、diff-check 通过;文档
## OVERLAY-02 动画专项复核
修复测量 transform 的 CSSOM px 规范化导致 Popover/Tooltip 跳过进入动画。真实浏览器事件及帧采样确认 Modal 遮罩/内容 150/250ms、Popover/Tooltip 进入 150ms、浮层退出 100ms,曲线与源 CSS 一致;详细对照见 OVERLAY-02 报告。新增 3 项测试,pnpm test 23 文件 / 380 项(含 node SSR 10);typecheck、build:docs、build:playground、format 与 diff-check 通过。未运行完整 React 站并排录像,未据此声明逐像素一致。
+
+## M24–M25 ScrollShadow / Tabs(2026-10-23)
+
+详细验证及边界见 [M24–M25](./migrations/M24-M25-scroll-shadow-tabs.md)。全部 17 个基线演示编译挂载,新增滚动/选择/禁用/键盘/受控/ID/SSR 实际水合验证。
+
+| 命令 | 文件 | 通过 | 范围 |
+| -------------- | ---- | ---- | -------------------------------- |
+| pnpm test | 24 | 394 | 含 node SSR 11 与 jsdom 实际水合 |
+| pnpm test:unit | 23 | 383 | 不含 node SSR |
+
+typecheck、build:docs、build:playground、format、diff-check 与 dist 正反类型消费通过。浏览器重点验证横向末端/RTL/垂直溢出、动态增减内容、禁用跳过、指示器和文档表格。未声明完整读屏/触屏、自动逐像素、Nuxt 或打包后独立安装。
diff --git a/package.json b/package.json
index 86496b0..54b7c53 100644
--- a/package.json
+++ b/package.json
@@ -15,7 +15,7 @@
"build:docs": "pnpm build && pnpm --filter @heroui-vue/docs build",
"typecheck": "vue-tsc --noEmit",
"test": "vitest run",
- "test:unit": "vitest run tests/choice-demos.test.ts tests/choice-fields.test.ts tests/fieldset-search-field.test.ts tests/components.test.ts tests/composition.test.ts tests/docs-search.test.ts tests/button-demos.test.ts tests/aligned-components.test.ts tests/surface-link-spinner.test.ts tests/close-button-avatar-skeleton.test.ts tests/separator-kbd-chip.test.ts tests/badge-alert.test.ts tests/input-group.test.ts tests/field-docs-textarea.test.ts tests/field-foundation.test.ts tests/typography-empty-breadcrumbs.test.ts tests/progress-meter.test.ts tests/disclosure-accordion.test.ts tests/overlay-foundation.test.ts tests/modal.test.ts tests/popover-tooltip.test.ts tests/overlay-demos.test.ts",
+ "test:unit": "vitest run tests/choice-demos.test.ts tests/choice-fields.test.ts tests/fieldset-search-field.test.ts tests/components.test.ts tests/composition.test.ts tests/docs-search.test.ts tests/button-demos.test.ts tests/aligned-components.test.ts tests/surface-link-spinner.test.ts tests/close-button-avatar-skeleton.test.ts tests/separator-kbd-chip.test.ts tests/badge-alert.test.ts tests/input-group.test.ts tests/field-docs-textarea.test.ts tests/field-foundation.test.ts tests/typography-empty-breadcrumbs.test.ts tests/progress-meter.test.ts tests/disclosure-accordion.test.ts tests/overlay-foundation.test.ts tests/modal.test.ts tests/popover-tooltip.test.ts tests/overlay-demos.test.ts tests/scroll-tabs.test.ts",
"test:ssr": "vitest run tests/ssr.test.ts",
"format": "prettier --check .",
"format:fix": "prettier --write .",
diff --git a/packages/styles/components/scroll-shadow.css b/packages/styles/components/scroll-shadow.css
new file mode 100644
index 0000000..dcfd38d
--- /dev/null
+++ b/packages/styles/components/scroll-shadow.css
@@ -0,0 +1,215 @@
+/* Adapted from HeroUI ce90ea3, Apache-2.0. See third-party/HEROUI-LICENSE. */
+/* Base scroll-shadow component */
+.hv-scroll-shadow {
+ @apply relative;
+ --scroll-shadow-size: 40px;
+ --scroll-shadow-scrollbar-size: 10px;
+ --scroll-shadow-offset: 0px;
+}
+
+/* Fade sizes for the scroll-driven variant below. They stay at 0px whenever the scroll
+ timeline is inactive, which is exactly the state of a container without overflow. */
+@property --scroll-shadow-start-fade {
+ syntax: "
";
+ inherits: false;
+ initial-value: 0px;
+}
+
+@property --scroll-shadow-end-fade {
+ syntax: "";
+ inherits: false;
+ initial-value: 0px;
+}
+
+@keyframes hv-scroll-shadow-start-fade {
+ from {
+ --scroll-shadow-start-fade: 0px;
+ }
+ to {
+ --scroll-shadow-start-fade: var(--scroll-shadow-size);
+ }
+}
+
+@keyframes hv-scroll-shadow-end-fade {
+ from {
+ --scroll-shadow-end-fade: var(--scroll-shadow-size);
+ }
+ to {
+ --scroll-shadow-end-fade: 0px;
+ }
+}
+
+/* Orientation: Vertical */
+.hv-scroll-shadow--vertical {
+ @apply scrollbar overflow-y-auto;
+}
+
+/* Orientation: Horizontal */
+.hv-scroll-shadow--horizontal {
+ @apply scrollbar overflow-x-auto;
+}
+
+/* Variant: Fade - Vertical */
+.hv-scroll-shadow--fade.hv-scroll-shadow--vertical {
+ /* `[data-scroll-shadow-mode="auto"]` lets the scroll-driven variant below reuse this
+ plumbing. It only paints once `--scroll-linear-gradient` is set, since an undefined
+ variable makes `mask-image` invalid at computed-value time, which resolves to `none`. */
+ &:where(
+ [data-top-scroll="true"],
+ [data-bottom-scroll="true"],
+ [data-top-bottom-scroll="true"],
+ [data-scroll-shadow-mode="auto"]
+ ) {
+ mask-image:
+ linear-gradient(var(--scroll-linear-gradient)),
+ linear-gradient(#000, #000);
+ mask-position:
+ left top,
+ right top;
+ mask-repeat: no-repeat;
+ mask-size:
+ calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,
+ var(--scroll-shadow-scrollbar-size) 100%;
+ -webkit-mask-image:
+ linear-gradient(var(--scroll-linear-gradient)),
+ linear-gradient(#000, #000);
+ -webkit-mask-position:
+ left top,
+ right top;
+ -webkit-mask-repeat: no-repeat;
+ -webkit-mask-size:
+ calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,
+ var(--scroll-shadow-scrollbar-size) 100%;
+ }
+
+ &[data-top-scroll="true"] {
+ --scroll-linear-gradient:
+ 0deg, #000 calc(100% - var(--scroll-shadow-size)), transparent;
+ }
+
+ &[data-bottom-scroll="true"] {
+ --scroll-linear-gradient:
+ 180deg, #000 calc(100% - var(--scroll-shadow-size)), transparent;
+ }
+
+ &[data-top-bottom-scroll="true"] {
+ --scroll-linear-gradient:
+ #000, #000, transparent 0, #000 var(--scroll-shadow-size),
+ #000 calc(100% - var(--scroll-shadow-size)), transparent;
+ }
+}
+
+/* Variant: Fade - Horizontal */
+.hv-scroll-shadow--fade.hv-scroll-shadow--horizontal {
+ &:where(
+ [data-left-scroll="true"],
+ [data-right-scroll="true"],
+ [data-left-right-scroll="true"],
+ [data-scroll-shadow-mode="auto"]
+ ) {
+ mask-image:
+ linear-gradient(var(--scroll-linear-gradient)),
+ linear-gradient(#000, #000);
+ mask-position:
+ left top,
+ left bottom;
+ mask-repeat: no-repeat;
+ mask-size:
+ 100% calc(100% - var(--scroll-shadow-scrollbar-size)),
+ 100% var(--scroll-shadow-scrollbar-size);
+ -webkit-mask-image:
+ linear-gradient(var(--scroll-linear-gradient)),
+ linear-gradient(#000, #000);
+ -webkit-mask-position:
+ left top,
+ left bottom;
+ -webkit-mask-repeat: no-repeat;
+ -webkit-mask-size:
+ 100% calc(100% - var(--scroll-shadow-scrollbar-size)),
+ 100% var(--scroll-shadow-scrollbar-size);
+ }
+
+ /* `left`/`right` data attributes are logical (before/end of scroll). In RTL the
+ start edge is on the right, so the physical fade direction must be swapped. */
+ &[data-left-scroll="true"] {
+ --scroll-linear-gradient:
+ 270deg, #000 calc(100% - var(--scroll-shadow-size)), transparent;
+
+ &:dir(rtl) {
+ --scroll-linear-gradient:
+ 90deg, #000 calc(100% - var(--scroll-shadow-size)), transparent;
+ }
+ }
+
+ &[data-right-scroll="true"] {
+ --scroll-linear-gradient:
+ 90deg, #000 calc(100% - var(--scroll-shadow-size)), transparent;
+
+ &:dir(rtl) {
+ --scroll-linear-gradient:
+ 270deg, #000 calc(100% - var(--scroll-shadow-size)), transparent;
+ }
+ }
+
+ &[data-left-right-scroll="true"] {
+ --scroll-linear-gradient:
+ to right, #000, #000, transparent 0, #000 var(--scroll-shadow-size),
+ #000 calc(100% - var(--scroll-shadow-size)), transparent;
+ }
+}
+
+.hv-scroll-shadow--hide-scrollbar {
+ @apply scrollbar-none;
+ --scroll-shadow-scrollbar-size: 0px;
+}
+
+/* Variant: Fade - scroll-driven
+ Where scroll timelines are available the fade is derived from the real scroll state,
+ so it is already correct on the first paint and needs no measurement or hydration.
+ A container without overflow has an inactive timeline, which leaves both fades at 0px
+ and collapses the mask to a no-op. The attribute-driven rules above remain the
+ fallback for engines without scroll timelines, and keep serving controlled mode.
+
+ Two consequences of deriving the mask from CSS alone:
+ - Auto mode always resolves a `mask-image`, even with nothing to scroll, so the root is
+ always a stacking context and a containing block for fixed descendants. Gating that on
+ overflow would need a measurement, which is the flicker this variant exists to avoid.
+ - The `animation` shorthand here lives in the components layer, so an `animate-*` utility
+ on the root replaces it and pins both fades at 0px, leaving no fade at all. */
+@supports (animation-timeline: scroll(self)) {
+ /* `.scroll-shadow` is repeated so these rules outrank the attribute-driven gradients
+ above on specificity rather than on source order, which a re-ordering could break. */
+ .hv-scroll-shadow.hv-scroll-shadow--fade[data-scroll-shadow-mode="auto"] {
+ animation:
+ hv-scroll-shadow-start-fade linear both,
+ hv-scroll-shadow-end-fade linear both;
+ animation-range:
+ var(--scroll-shadow-offset)
+ calc(var(--scroll-shadow-offset) + var(--scroll-shadow-size)),
+ calc(100% - var(--scroll-shadow-size) - var(--scroll-shadow-offset))
+ calc(100% - var(--scroll-shadow-offset));
+ }
+
+ /* The orientation rules also outrank the `animation` shorthand above, which resets
+ `animation-timeline` to `auto`, so the timeline survives regardless of order. */
+ .hv-scroll-shadow.hv-scroll-shadow--fade.hv-scroll-shadow--vertical[data-scroll-shadow-mode="auto"] {
+ animation-timeline: scroll(self block), scroll(self block);
+ --scroll-linear-gradient:
+ 180deg, transparent 0, #000 var(--scroll-shadow-start-fade),
+ #000 calc(100% - var(--scroll-shadow-end-fade)), transparent 100%;
+ }
+
+ .hv-scroll-shadow.hv-scroll-shadow--fade.hv-scroll-shadow--horizontal[data-scroll-shadow-mode="auto"] {
+ animation-timeline: scroll(self inline), scroll(self inline);
+ --scroll-linear-gradient:
+ 90deg, transparent 0, #000 var(--scroll-shadow-start-fade),
+ #000 calc(100% - var(--scroll-shadow-end-fade)), transparent 100%;
+
+ /* Inline-axis progress starts at the right edge in RTL, so flip the physical direction */
+ &:dir(rtl) {
+ --scroll-linear-gradient:
+ 270deg, transparent 0, #000 var(--scroll-shadow-start-fade),
+ #000 calc(100% - var(--scroll-shadow-end-fade)), transparent 100%;
+ }
+ }
+}
diff --git a/packages/styles/components/tabs.css b/packages/styles/components/tabs.css
new file mode 100644
index 0000000..0df4241
--- /dev/null
+++ b/packages/styles/components/tabs.css
@@ -0,0 +1,303 @@
+/* Adapted from HeroUI ce90ea3, Apache-2.0. See third-party/HEROUI-LICENSE. */
+/* Base tabs component */
+.hv-tabs {
+ @apply flex gap-2;
+
+ /* Orientation styles */
+ &[data-orientation="horizontal"] {
+ @apply flex-col;
+ }
+
+ &[data-orientation="vertical"] {
+ @apply flex-row;
+ }
+}
+
+/* Tab list container */
+.hv-tabs__list-container {
+ @apply relative bg-default;
+
+ border-radius: calc(var(--radius) * 2.5);
+
+ /* Vertical scroller fills the container height so overflow detection
+ engages when the wrapper height is constrained (e.g. h-[240px]) */
+ > .hv-tabs__list-container__scroller[data-orientation="vertical"] {
+ @apply h-full;
+ }
+
+ /* Overflow chevron buttons */
+ > .hv-tabs__list-container__scroll-prev,
+ > .hv-tabs__list-container__scroll-next {
+ @apply absolute z-2 hidden size-4 cursor-(--cursor-interactive) items-center justify-center rounded-full border-0 bg-transparent p-0 text-foreground outline-none;
+
+ /**
+ * Transitions
+ * CRITICAL: motion-reduce must be AFTER transition for correct override specificity
+ */
+ transition: opacity 150ms var(--ease-smooth);
+ @apply motion-reduce:transition-none;
+
+ @media (hover: hover) {
+ &:hover {
+ @apply opacity-70;
+ }
+ }
+
+ &:focus-visible {
+ @apply status-focused;
+ }
+ }
+
+ /* Chevron position - horizontal orientation */
+ &:has([data-orientation="horizontal"]) {
+ > .hv-tabs__list-container__scroll-prev {
+ @apply start-1 top-1/2 -translate-y-1/2;
+ }
+
+ > .hv-tabs__list-container__scroll-next {
+ @apply end-1 top-1/2 -translate-y-1/2;
+ }
+
+ > .hv-tabs__list-container__scroll-prev,
+ > .hv-tabs__list-container__scroll-next {
+ @apply rtl:rotate-180;
+ }
+ }
+
+ /* Chevron position - vertical orientation */
+ &:has([data-orientation="vertical"]) {
+ > .hv-tabs__list-container__scroll-prev {
+ @apply top-1 left-1/2 -translate-x-1/2;
+ }
+
+ > .hv-tabs__list-container__scroll-next {
+ @apply bottom-1 left-1/2 -translate-x-1/2;
+ }
+ }
+
+ /* Show chevrons only when ScrollShadow reports scrolling is possible */
+ &:has(
+ > :is(
+ [data-left-scroll="true"],
+ [data-left-right-scroll="true"],
+ [data-top-scroll="true"],
+ [data-top-bottom-scroll="true"]
+ )
+ )
+ > .hv-tabs__list-container__scroll-prev {
+ @apply inline-flex;
+ }
+
+ &:has(
+ > :is(
+ [data-right-scroll="true"],
+ [data-left-right-scroll="true"],
+ [data-bottom-scroll="true"],
+ [data-top-bottom-scroll="true"]
+ )
+ )
+ > .hv-tabs__list-container__scroll-next {
+ @apply inline-flex;
+ }
+}
+
+/* Tab list */
+.hv-tabs__list {
+ @apply inline-flex p-1;
+
+ /* Horizontal orientation - grow with content so ScrollShadow can detect overflow */
+ &[data-orientation="horizontal"] {
+ @apply w-max min-w-full flex-row;
+ }
+
+ /* Vertical orientation */
+ &[data-orientation="vertical"] {
+ @apply flex-col gap-1;
+
+ .hv-tabs__tab {
+ @apply min-w-20;
+ }
+ }
+}
+
+/* Individual tab */
+.hv-tabs__tab {
+ @apply relative flex h-8 w-full items-center justify-center rounded-3xl px-4 text-center text-sm font-medium text-muted outline-none no-highlight;
+
+ z-index: 1;
+ cursor: var(--cursor-interactive);
+
+ /**
+ * Transitions
+ * CRITICAL: motion-reduce must be AFTER transition for correct override specificity
+ */
+ transition:
+ color 150ms var(--ease-smooth),
+ background-color 150ms var(--ease-smooth),
+ box-shadow 150ms var(--ease-out),
+ opacity 150ms var(--ease-smooth);
+ @apply motion-reduce:transition-none;
+
+ /* Selected state */
+ &[data-selected="true"] {
+ @apply text-segment-foreground;
+
+ /* Hide separator on the selected tab and the one following it */
+ .hv-tabs__separator,
+ & + .hv-tabs__tab .hv-tabs__separator {
+ @apply opacity-0;
+ }
+ }
+
+ /* Disabled state */
+ &:disabled,
+ &[data-disabled],
+ &[aria-disabled="true"] {
+ @apply status-disabled;
+ }
+
+ /* Hover states - both approaches for compatibility */
+ @media (hover: hover) {
+ &:not([data-selected="true"]):not([data-disabled]):hover,
+ &[data-hovered="true"]:not([data-selected="true"]):not([data-disabled]) {
+ @apply opacity-70;
+ }
+ }
+
+ /* Focus states - comprehensive fallback */
+ &:focus-visible:not([data-focused]),
+ &[data-focus-visible="true"] {
+ @apply status-focused;
+ }
+}
+
+/* Tab content alignment - center is the default, handled by .hv-tabs__tab.
+ Scoped to the direct child holding the tab list (the list container, or the
+ list itself when Tabs.ListContainer is omitted) so a nested Tabs inside a
+ panel keeps its own alignment. */
+.hv-tabs--align-start
+ > :is(.hv-tabs__list-container, .hv-tabs__list)
+ .hv-tabs__tab {
+ @apply justify-start text-start;
+}
+
+.hv-tabs--align-end
+ > :is(.hv-tabs__list-container, .hv-tabs__list)
+ .hv-tabs__tab {
+ @apply justify-end text-end;
+}
+
+/* Tab separator */
+.hv-tabs__separator {
+ @apply pointer-events-none absolute rounded-sm bg-muted/25;
+
+ /**
+ * Transitions
+ * CRITICAL: motion-reduce must be AFTER transition for correct override specificity
+ */
+ transition: opacity 150ms var(--ease-smooth);
+ @apply motion-reduce:transition-none;
+
+ /* Horizontal tabs - vertical separator */
+ .hv-tabs__list[data-orientation="horizontal"] & {
+ @apply start-0 top-1/4 h-1/2 w-px;
+ }
+
+ /* Vertical tabs - horizontal separator */
+ .hv-tabs__list[data-orientation="vertical"] & {
+ @apply start-[5%] top-0 h-px w-[90%];
+ }
+}
+
+/* Tab panel */
+.hv-tabs__panel {
+ @apply w-full p-2 outline-none;
+
+ /* Exiting animations */
+ &[data-exiting="true"] {
+ @apply absolute start-0 top-0 w-full;
+ }
+
+ /* Orientation spacing */
+ &[data-orientation="horizontal"] {
+ @apply mt-4;
+ }
+
+ &[data-orientation="vertical"] {
+ @apply ms-4;
+ }
+}
+
+/* Tab indicator - React Aria's SelectionIndicator */
+.hv-tabs__indicator {
+ @apply absolute start-0 top-0 size-full rounded-3xl bg-segment shadow-surface;
+
+ z-index: -1;
+
+ /**
+ * Transitions
+ * CRITICAL: motion-reduce must be AFTER transition for correct override specificity
+ */
+ transition-duration: 250ms;
+ transition-property: translate, width, height;
+ transition-timing-function: var(--ease-out-fluid);
+ @apply motion-reduce:transition-none;
+}
+
+/* ==========================================================================
+ Secondary Variant
+ ========================================================================== */
+
+.hv-tabs--secondary {
+ /* Container - flat, no pill. Underline on container (not list) so it stays
+ stable when the inner list scrolls horizontally inside the ScrollShadow. */
+ > .hv-tabs__list-container {
+ @apply rounded-none bg-transparent;
+
+ /* Tab list - remove padding */
+ .hv-tabs__list {
+ @apply p-0;
+ }
+
+ /* Hide separators in secondary variant */
+ .hv-tabs__separator {
+ @apply hidden;
+ }
+
+ /* Tab - adjust for secondary variant */
+ .hv-tabs__tab {
+ @apply rounded-none;
+
+ /* Selected state - use text-foreground */
+ &[data-selected="true"] {
+ @apply text-foreground;
+ }
+ }
+
+ /* Tab indicator - line style */
+ .hv-tabs__indicator {
+ @apply rounded-none bg-accent shadow-none;
+ }
+ }
+
+ /* Horizontal orientation - bottom border + bottom line indicator */
+ &[data-orientation="horizontal"] > .hv-tabs__list-container {
+ @apply border-b border-border;
+
+ .hv-tabs__indicator {
+ @apply top-auto bottom-0 h-0.5;
+ }
+ }
+
+ /* Vertical orientation - left border + left line indicator */
+ &[data-orientation="vertical"] > .hv-tabs__list-container {
+ @apply border-s border-border;
+
+ .hv-tabs__indicator {
+ @apply start-0 top-0 h-full w-0.5;
+ }
+ }
+}
+
+/* Reka roving-focus navigation requires an empty data-disabled marker.
+ * Match its presence instead of changing it to RAC boolean strings. */
diff --git a/packages/styles/index.css b/packages/styles/index.css
index e680ee9..eb22bd4 100644
--- a/packages/styles/index.css
+++ b/packages/styles/index.css
@@ -127,3 +127,6 @@
@import "./components/popover.css" layer(components);
@import "./components/tooltip.css" layer(components);
+
+@import "./components/scroll-shadow.css";
+@import "./components/tabs.css";
diff --git a/packages/styles/src/index.ts b/packages/styles/src/index.ts
index 2422ede..3bc0a94 100644
--- a/packages/styles/src/index.ts
+++ b/packages/styles/src/index.ts
@@ -978,3 +978,81 @@ export const tooltipVariants = tv({
});
export type TooltipVariants = VariantProps;
+
+export const scrollShadowVariants = tv({
+ defaultVariants: {
+ hideScrollBar: false,
+ orientation: "vertical",
+ variant: "fade",
+ },
+ slots: {
+ base: "hv-scroll-shadow",
+ },
+ variants: {
+ hideScrollBar: {
+ false: {},
+ true: {
+ base: "hv-scroll-shadow--hide-scrollbar",
+ },
+ },
+ orientation: {
+ horizontal: {
+ base: "hv-scroll-shadow--horizontal",
+ },
+ vertical: {
+ base: "hv-scroll-shadow--vertical",
+ },
+ },
+ variant: {
+ fade: {
+ base: "hv-scroll-shadow--fade",
+ },
+ },
+ },
+});
+
+export type ScrollShadowVariants = VariantProps;
+
+export const tabsVariants = tv({
+ defaultVariants: {
+ align: "center",
+ variant: "primary",
+ },
+ slots: {
+ base: "hv-tabs",
+ scrollNext: "hv-tabs__list-container__scroll-next",
+ scrollPrev: "hv-tabs__list-container__scroll-prev",
+ scroller: "hv-tabs__list-container__scroller",
+ separator: "hv-tabs__separator",
+ tab: "hv-tabs__tab",
+ tabIndicator: "hv-tabs__indicator",
+ tabList: "hv-tabs__list",
+ tabListContainer: "hv-tabs__list-container",
+ tabPanel: "hv-tabs__panel",
+ },
+ variants: {
+ align: {
+ center: {}, // No class as the base already centers tab content
+ end: {
+ base: "hv-tabs--align-end",
+ },
+ start: {
+ base: "hv-tabs--align-start",
+ },
+ },
+ variant: {
+ primary: {},
+ secondary: {
+ base: "hv-tabs--secondary",
+ },
+ },
+ },
+});
+
+// Render props that should be excluded from TabsVariants (framework-specific)
+type TabsRenderPropsKeys = "selectedKey";
+
+export type TabsVariants = Omit<
+ VariantProps,
+ TabsRenderPropsKeys
+>;
diff --git a/packages/vue/package.json b/packages/vue/package.json
index 336b670..d41d240 100644
--- a/packages/vue/package.json
+++ b/packages/vue/package.json
@@ -20,6 +20,7 @@
},
"dependencies": {
"@heroui-vue/styles": "workspace:*",
+ "@vueuse/core": "14.4.0",
"reka-ui": "^2.11.0"
},
"peerDependencies": {
diff --git a/packages/vue/src/components/scroll-shadow/ScrollShadow.vue b/packages/vue/src/components/scroll-shadow/ScrollShadow.vue
new file mode 100644
index 0000000..34dbc11
--- /dev/null
+++ b/packages/vue/src/components/scroll-shadow/ScrollShadow.vue
@@ -0,0 +1,65 @@
+
+
+
+
+
+
diff --git a/packages/vue/src/components/scroll-shadow/types.ts b/packages/vue/src/components/scroll-shadow/types.ts
new file mode 100644
index 0000000..26eaa00
--- /dev/null
+++ b/packages/vue/src/components/scroll-shadow/types.ts
@@ -0,0 +1,2 @@
+export type ScrollShadowVisibility =
+ "auto" | "both" | "top" | "bottom" | "left" | "right" | "none";
diff --git a/packages/vue/src/components/scroll-shadow/useScrollShadow.ts b/packages/vue/src/components/scroll-shadow/useScrollShadow.ts
new file mode 100644
index 0000000..7f36433
--- /dev/null
+++ b/packages/vue/src/components/scroll-shadow/useScrollShadow.ts
@@ -0,0 +1,119 @@
+import {
+ computed,
+ ref,
+ watch,
+ onScopeDispose,
+ toValue,
+ type MaybeRefOrGetter,
+} from "vue";
+import {
+ useEventListener,
+ useMutationObserver,
+ useResizeObserver,
+} from "@vueuse/core";
+import type { ScrollShadowVisibility } from "./types";
+export interface UseScrollShadowProps {
+ containerRef: MaybeRefOrGetter;
+ orientation?: MaybeRefOrGetter<"vertical" | "horizontal">;
+ visibility?: MaybeRefOrGetter;
+ offset?: MaybeRefOrGetter;
+ isEnabled?: MaybeRefOrGetter;
+ onVisibilityChange?: (visibility: ScrollShadowVisibility) => void;
+}
+/** Vue counterpart of the fixed HeroUI scroll measurement hook; bind attributes to the scroll root. */
+export function useScrollShadow(options: UseScrollShadowProps) {
+ const element = computed(() => toValue(options.containerRef));
+ const orientation = computed(
+ () => toValue(options.orientation) ?? "vertical",
+ );
+ const visibility = computed(() => toValue(options.visibility) ?? "auto");
+ const offset = computed(() => toValue(options.offset) ?? 0);
+ const isEnabled = computed(() => toValue(options.isEnabled) ?? true);
+ const detected = ref("none");
+ const current = computed(() =>
+ visibility.value !== "auto"
+ ? visibility.value
+ : isEnabled.value
+ ? detected.value
+ : "none",
+ );
+ let frame: number | undefined;
+ let previous: ScrollShadowVisibility | undefined;
+ function measure() {
+ if (
+ frame !== undefined ||
+ !element.value ||
+ !isEnabled.value ||
+ visibility.value !== "auto"
+ )
+ return;
+ frame = requestAnimationFrame(() => {
+ frame = undefined;
+ const el = element.value;
+ if (!el || !isEnabled.value || visibility.value !== "auto") return;
+ const vertical = orientation.value === "vertical";
+ const start = vertical ? el.scrollTop : Math.abs(el.scrollLeft);
+ const before = start > offset.value;
+ const after =
+ start + (vertical ? el.clientHeight : el.clientWidth) + offset.value <
+ (vertical ? el.scrollHeight : el.scrollWidth) - 1;
+ const value =
+ before && after
+ ? "both"
+ : before
+ ? vertical
+ ? "top"
+ : "left"
+ : after
+ ? vertical
+ ? "bottom"
+ : "right"
+ : "none";
+ detected.value = value;
+ if (value !== previous) {
+ previous = value;
+ options.onVisibilityChange?.(value);
+ }
+ });
+ }
+ watch(
+ () => [orientation.value, visibility.value, isEnabled.value, offset.value],
+ () => {
+ if (frame !== undefined) cancelAnimationFrame(frame);
+ frame = undefined;
+ previous = undefined;
+ detected.value = "none";
+ measure();
+ },
+ { flush: "post" },
+ );
+ useEventListener(element, "scroll", measure, { passive: true });
+ useEventListener(element, "load", measure, { capture: true });
+ useResizeObserver(element, measure);
+ useMutationObserver(element, measure, {
+ attributes: true,
+ attributeFilter: ["class", "style", "dir"],
+ childList: true,
+ characterData: true,
+ subtree: true,
+ });
+ watch(element, measure, { flush: "post" });
+ onScopeDispose(() => {
+ if (frame !== undefined) cancelAnimationFrame(frame);
+ });
+ const states = computed(() => {
+ const v = current.value;
+ return {
+ "data-top-scroll": v === "top" ? "true" : undefined,
+ "data-bottom-scroll": v === "bottom" ? "true" : undefined,
+ "data-left-scroll": v === "left" ? "true" : undefined,
+ "data-right-scroll": v === "right" ? "true" : undefined,
+ "data-top-bottom-scroll":
+ v === "both" && orientation.value === "vertical" ? "true" : undefined,
+ "data-left-right-scroll":
+ v === "both" && orientation.value === "horizontal" ? "true" : undefined,
+ };
+ });
+
+ return { visibility: current, attributes: states, update: measure };
+}
diff --git a/packages/vue/src/components/tabs/Tabs.ts b/packages/vue/src/components/tabs/Tabs.ts
new file mode 100644
index 0000000..b24fa8d
--- /dev/null
+++ b/packages/vue/src/components/tabs/Tabs.ts
@@ -0,0 +1,256 @@
+import {
+ computed,
+ defineComponent,
+ h,
+ provide,
+ ref,
+ shallowRef,
+ shallowReactive,
+ useId,
+ watch,
+ onBeforeUnmount,
+ type PropType,
+ type VNode,
+ Fragment,
+ isVNode,
+ mergeProps,
+} from "vue";
+import { TabsRoot } from "reka-ui";
+import { useMutationObserver, useResizeObserver } from "@vueuse/core";
+import { tabsVariants } from "@heroui-vue/styles";
+import { useConfig } from "../../providers/context";
+import { tabsKey, tabsWireKey, type TabsKey, type TabBox } from "./context";
+function members(
+ nodes: VNode[],
+ output: { tabs: { key: TabsKey; disabled: boolean }[]; panels: Set },
+) {
+ for (const node of nodes) {
+ if (!isVNode(node)) continue;
+ const name =
+ typeof node.type === "object"
+ ? ((node.type as { name?: string; __name?: string }).name ??
+ (node.type as { __name?: string }).__name)
+ : "";
+ if (name === "Tabs") continue;
+ const key = node.props?.value ?? node.props?.id;
+ if (name === "TabsTab" && key !== undefined)
+ output.tabs.push({
+ key,
+ disabled:
+ node.props?.isDisabled === "" ||
+ node.props?.["is-disabled"] === "" ||
+ !!node.props?.["is-disabled"] ||
+ !!node.props?.isDisabled ||
+ !!node.props?.disabled,
+ });
+ if (name === "TabsPanel" && key !== undefined) output.panels.add(key);
+ if (Array.isArray(node.children))
+ members(node.children.filter(isVNode), output);
+ else if (
+ ["TabsListContainer", "TabsList"].includes(name || "") &&
+ node.children &&
+ typeof node.children === "object" &&
+ "default" in node.children
+ ) {
+ const slot = node.children.default;
+ if (typeof slot === "function") members(slot(), output);
+ }
+ }
+}
+export default defineComponent({
+ name: "Tabs",
+ inheritAttrs: false,
+ props: {
+ modelValue: [String, Number] as PropType,
+ selectedKey: [String, Number] as PropType,
+ defaultValue: [String, Number] as PropType,
+ defaultSelectedKey: [String, Number] as PropType,
+ orientation: {
+ type: String as PropType<"horizontal" | "vertical">,
+ default: "horizontal",
+ },
+ variant: {
+ type: String as PropType<"primary" | "secondary">,
+ default: "primary",
+ },
+ align: {
+ type: String as PropType<"start" | "center" | "end">,
+ default: "center",
+ },
+ keyboardActivation: {
+ type: String as PropType<"automatic" | "manual">,
+ default: "automatic",
+ },
+ disabledKeys: {
+ type: Array as PropType,
+ default: () => [],
+ },
+ isDisabled: Boolean,
+ dir: String as PropType<"ltr" | "rtl">,
+ as: { type: String, default: "div" },
+ },
+ emits: {
+ "update:modelValue": (key: TabsKey) =>
+ typeof key === "string" || typeof key === "number",
+ "update:selectedKey": (key: TabsKey) =>
+ typeof key === "string" || typeof key === "number",
+ selectionChange: (key: TabsKey) =>
+ typeof key === "string" || typeof key === "number",
+ },
+ setup(props, { attrs, slots, emit }) {
+ const config = useConfig(),
+ base = useId();
+ const local = ref(
+ props.defaultValue ?? props.defaultSelectedKey,
+ );
+ const options = shallowRef<{ key: TabsKey; disabled: boolean }[]>([]);
+ const panels = shallowRef(new Set());
+ const disabled = (key: TabsKey) =>
+ props.isDisabled ||
+ props.disabledKeys.includes(key) ||
+ !!options.value.find((t) => t.key === key)?.disabled;
+ const selected = computed(
+ () =>
+ props.modelValue ??
+ props.selectedKey ??
+ (local.value !== undefined &&
+ (!options.value.length ||
+ options.value.some((t) => t.key === local.value && !disabled(t.key)))
+ ? local.value
+ : options.value.find((t) => !disabled(t.key))?.key),
+ );
+ // Persist a reconciliation so re-enabling a removed/disabled default tab
+ // does not resurrect a selection the user already lost.
+ watch(
+ () => [options.value, ...props.disabledKeys, props.isDisabled],
+ () => {
+ if (props.modelValue !== undefined || props.selectedKey !== undefined)
+ return;
+ if (
+ !options.value.some((t) => t.key === local.value && !disabled(t.key))
+ )
+ local.value = options.value.find((t) => !disabled(t.key))?.key;
+ },
+ { flush: "sync" },
+ );
+ const dir = computed(() => props.dir ?? config?.dir.value ?? "ltr");
+ function select(key: TabsKey) {
+ if (disabled(key) || key === selected.value) return;
+ if (props.modelValue === undefined && props.selectedKey === undefined)
+ local.value = key;
+ emit("update:modelValue", key);
+ emit("update:selectedKey", key);
+ emit("selectionChange", key);
+ }
+ const list = ref();
+ const elements = shallowReactive(new Map());
+ const boxes = shallowRef(new Map());
+ const ready = ref(false);
+ let frame: number | undefined;
+ function measure() {
+ const next = new Map();
+ for (const [key, el] of elements)
+ if (el.isConnected) {
+ // Layout coordinates remain stable while an ancestor Modal is scaling.
+ next.set(key, {
+ x: el.offsetLeft,
+ y: el.offsetTop,
+ width: el.offsetWidth,
+ height: el.offsetHeight,
+ });
+ }
+ if (
+ next.size !== boxes.value.size ||
+ [...next].some(([key, b]) => {
+ const old = boxes.value.get(key);
+ return (
+ !old ||
+ old.x !== b.x ||
+ old.y !== b.y ||
+ old.width !== b.width ||
+ old.height !== b.height
+ );
+ })
+ )
+ boxes.value = next;
+ if (!ready.value && next.size && frame === undefined)
+ frame = requestAnimationFrame(() => {
+ frame = undefined;
+ ready.value = true;
+ });
+ }
+ useResizeObserver(
+ computed(() =>
+ [list.value, ...elements.values()].filter(
+ (el): el is HTMLElement => !!el,
+ ),
+ ),
+ measure,
+ );
+ useMutationObserver(list, measure, {
+ childList: true,
+ subtree: true,
+ characterData: true,
+ attributes: true,
+ attributeFilter: ["class", "dir"],
+ });
+ watch(() => [props.orientation, dir.value], measure, { flush: "post" });
+ onBeforeUnmount(() => {
+ if (frame !== undefined) cancelAnimationFrame(frame);
+ });
+ provide(tabsKey, {
+ selected,
+ keyboardActivation: computed(() => props.keyboardActivation),
+ select,
+ orientation: computed(() => props.orientation),
+ variant: computed(() => props.variant),
+ dir,
+ disabled,
+ domId: (kind, key) =>
+ `hv-tabs-${base}-${kind}-${typeof key}-${encodeURIComponent(String(key))}`,
+ panels,
+ list,
+ elements,
+ boxes,
+ ready,
+ measure,
+ });
+ return () => {
+ const nodes = slots.default?.({ selectedKey: selected.value }) ?? [];
+ const found = {
+ tabs: [] as { key: TabsKey; disabled: boolean }[],
+ panels: new Set(),
+ };
+ members(nodes, found);
+ if (JSON.stringify(found.tabs) !== JSON.stringify(options.value))
+ options.value = found.tabs;
+ if (
+ found.panels.size !== panels.value.size ||
+ [...found.panels].some((key) => !panels.value.has(key))
+ )
+ panels.value = found.panels;
+ return h(
+ TabsRoot,
+ mergeProps(attrs, {
+ as: props.as,
+ modelValue: tabsWireKey(selected.value),
+ "onUpdate:modelValue": (key: string | number) => {
+ if (typeof key !== "string") return;
+ if (key.startsWith("n:")) select(Number(key.slice(2)));
+ else if (key.startsWith("s:")) select(key.slice(2));
+ },
+ orientation: props.orientation,
+ activationMode: "manual",
+ unmountOnHide: false,
+ dir: dir.value,
+ class: tabsVariants({
+ variant: props.variant,
+ align: props.align,
+ }).base(),
+ "data-slot": "tabs",
+ }),
+ { default: () => nodes },
+ );
+ };
+ },
+});
diff --git a/packages/vue/src/components/tabs/TabsIndicator.vue b/packages/vue/src/components/tabs/TabsIndicator.vue
new file mode 100644
index 0000000..05335c0
--- /dev/null
+++ b/packages/vue/src/components/tabs/TabsIndicator.vue
@@ -0,0 +1,41 @@
+
+
+
+
+
+
diff --git a/packages/vue/src/components/tabs/TabsList.vue b/packages/vue/src/components/tabs/TabsList.vue
new file mode 100644
index 0000000..4f09566
--- /dev/null
+++ b/packages/vue/src/components/tabs/TabsList.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
+
diff --git a/packages/vue/src/components/tabs/TabsListContainer.vue b/packages/vue/src/components/tabs/TabsListContainer.vue
new file mode 100644
index 0000000..a067e2f
--- /dev/null
+++ b/packages/vue/src/components/tabs/TabsListContainer.vue
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/vue/src/components/tabs/TabsPanel.vue b/packages/vue/src/components/tabs/TabsPanel.vue
new file mode 100644
index 0000000..46b28b8
--- /dev/null
+++ b/packages/vue/src/components/tabs/TabsPanel.vue
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
diff --git a/packages/vue/src/components/tabs/TabsScrollIcon.vue b/packages/vue/src/components/tabs/TabsScrollIcon.vue
new file mode 100644
index 0000000..8ce8680
--- /dev/null
+++ b/packages/vue/src/components/tabs/TabsScrollIcon.vue
@@ -0,0 +1,28 @@
+
+
+
+
diff --git a/packages/vue/src/components/tabs/TabsSeparator.vue b/packages/vue/src/components/tabs/TabsSeparator.vue
new file mode 100644
index 0000000..387d788
--- /dev/null
+++ b/packages/vue/src/components/tabs/TabsSeparator.vue
@@ -0,0 +1,15 @@
+
+
+
+
+
+
diff --git a/packages/vue/src/components/tabs/TabsTab.vue b/packages/vue/src/components/tabs/TabsTab.vue
new file mode 100644
index 0000000..5fb0ad6
--- /dev/null
+++ b/packages/vue/src/components/tabs/TabsTab.vue
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
diff --git a/packages/vue/src/components/tabs/context.ts b/packages/vue/src/components/tabs/context.ts
new file mode 100644
index 0000000..31a4e42
--- /dev/null
+++ b/packages/vue/src/components/tabs/context.ts
@@ -0,0 +1,44 @@
+import { inject, type InjectionKey, type Ref, type ComputedRef } from "vue";
+export type TabsKey = string | number;
+export interface TabBox {
+ x: number;
+ y: number;
+ width: number;
+ height: number;
+}
+export interface TabsContext {
+ selected: ComputedRef;
+ keyboardActivation: ComputedRef<"automatic" | "manual">;
+ select: (value: TabsKey) => void;
+ orientation: ComputedRef<"horizontal" | "vertical">;
+ variant: ComputedRef<"primary" | "secondary">;
+ dir: ComputedRef<"ltr" | "rtl">;
+ disabled: (key: TabsKey) => boolean;
+ domId: (kind: "tab" | "panel", key: TabsKey) => string;
+ panels: Ref>;
+ list: Ref;
+ elements: Map;
+ boxes: Ref