feat(tab-bar): add liquid glass effect - #2276
Open
ChenXiaoming233 wants to merge 2 commits into
Open
Conversation
- add the public effect="glass" API and the capsule theme - render layered glass materials and a shared selection indicator while preserving existing TabBar behavior - generate superellipse displacement and specular textures for lifecycle-managed SVG filters - provide a readable CSS fallback for unsupported browsers, SSR, Canvas failures, and runtime capability changes - synchronize pointer press feedback across the capsule, icons, and labels - support multiple instances, runtime effect switching, resource cleanup, and reduced-motion preferences - add the Liquid Glass demo, documentation, runtime tests, interaction tests, and displacement coverage - exclude demos and tests from production builds and verify the shared common submodule integrity feat(tab-bar): 实现液态玻璃效果与胶囊主题 - 新增公开的 effect="glass" API 和 capsule 主题 - 渲染分层玻璃材质与共享选中指示器,同时保持现有 TabBar 行为不变 - 生成超椭圆位移与高光纹理,并管理 SVG Filter 的完整生命周期 - 为不支持的浏览器、SSR、Canvas 失败和运行时能力变化提供可读的 CSS 降级效果 - 为胶囊、图标和文字提供同步的指针按压反馈 - 支持多实例、运行时效果切换、资源清理和 reduced-motion 偏好 - 补充 Liquid Glass 示例、组件文档、运行时测试、交互测试和位移效果测试 - 从生产构建中排除 Demo 与测试文件,并校验 common 子模块完整性
ChenXiaoming233
requested review from
anlyyao,
liweijie0812 and
novlan1
as code owners
July 28, 2026 18:38
This was referenced Jul 28, 2026
Contributor
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🤔 这个 PR 的性质是?
🔗 相关 Issue
关联 PR
💡 需求背景和解决方案
为 TabBar 接入渐进增强的 Liquid Glass 材质,并提供独立的共享胶囊选中主题。
公开 API
最终 API 实现与用法
主要改动
新增 Liquid Glass API
src/tab-bar/type.ts:新增effect?: 'normal' | 'glass',并为theme增加capsule。src/tab-bar/props.ts:补充默认值和枚举校验;默认effect="normal",保持兼容。TabBar 渲染玻璃材质与共享胶囊
src/tab-bar/tab-bar.tsx:shape="round" + theme="capsule"时渲染共享移动选中胶囊。TabBarItem 交互适配
src/tab-bar/tab-bar-item.tsx:prefers-reduced-motion下取消缩放和移动动画。实现折射纹理生成
src/tab-bar/liquid-glass-map.ts:管理滤镜生命周期
src/tab-bar/useTabBarGlassFilter.ts:新增公开 Demo 与文档
src/tab-bar/demos/glass.vue:展示 Classic tag 和 Shared capsule 两种 Glass 组合。src/tab-bar/demos/mobile.vue:将 Glass 示例接入组件 Demo。src/tab-bar/tab-bar.md、tab-bar.en-US.md:补充 API 和降级说明。液态玻璃 CSS 变量
(
style/mobile/components/tab-bar/_var.less)效果图 与 Playground:
在此提供了 Classic 与 Capsule 两种主题分别处于 Normal / CSS Fallback / LiquidGlass 在深浅模式下的效果图;
同时,为能更直观地观察参数调整对 Glass 材质视觉效果带来的影响,此处提供两个 Playground 用于实践:
效果图:
Playground:
📝 更新日志
☑️ 本地验证
git diff --check☑️ 请求合并前的自查清单