expo-liquid-glass by devanshudesai/agent-skills
npx skills add https://github.com/devanshudesai/agent-skills --skill expo-liquid-glass交付具备原生质感、保持清晰可读性,并在 iOS/Android 上安全降级的 Liquid Glass UI。
expo-glass-effect 和 @expo/ui 在 iOS 的 Expo Go 中不可靠。对于涉及重大视觉设计决策的任务,请根据以下 HIG 分类进行评估:
实用的设计指导请参见 references/apple-liquid-glass-design.md。如果提议的样式与 HIG 意图冲突,请优先选择符合 HIG 的选项。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 路径 | 适用场景 | 权衡 |
|---|---|---|
expo-glass-effect | 大多数需要玻璃碎片、浮动按钮、工具栏、分组控件的 RN 屏幕 | Expo 中的最佳默认选择;必须保护运行时可用性 |
@expo/ui (Host + SwiftUI 修饰符) | 原生 SwiftUI 组合、高级玻璃过渡效果、协调的 ID/命名空间 | 仅限 iOS 系列、开发构建工作流、SwiftUI 思维模型 |
expo-router/unstable-native-tabs | 系统原生的 Liquid Glass 标签栏和 iOS 26 导航行为 | 不稳定 API;SDK 54 和 55 的语法不同 |
@callstack/liquid-glass | 非 Expo RN 或标准化使用 Callstack 包的团队 | 专注于 iOS/tvOS;同样需要降级方案和运行时检查 |
在适当时组合路径:
expo-glass-effect 实现浮动控件。@expo/ui。在实现视觉效果前应用这些规则:
import { Platform, View } from 'react-native';
import { BlurView } from 'expo-blur';
import { GlassView, isGlassEffectAPIAvailable } from 'expo-glass-effect';
export function AdaptiveGlass({ style, children }) {
if (isGlassEffectAPIAvailable()) {
return (
<GlassView style={style} glassEffectStyle="regular" tintColor="#FFFFFF10">
{children}
</GlassView>
);
}
if (Platform.OS === 'ios') {
return (
<BlurView style={style} intensity={40} tint="dark">
{children}
</BlurView>
);
}
return <View style={[style, { backgroundColor: 'rgba(60,60,67,0.30)' }]}>{children}</View>;
}
expo-glass-effect 用法glassEffectStyle:'regular' | 'clear' | 'identity'。GlassView 或其父元素上设置 opacity < 1。isInteractive 视为仅在挂载时有效。如果必须更改,请使用 key 重新挂载。GlassView 内部放置可滚动内容。isGlassEffectAPIAvailable() 检查可用性。SDK 55+ 复合 API:
<NativeTabs.Trigger name="index">
<NativeTabs.Trigger.TabBarIcon
ios={{ default: 'house', selected: 'house.fill' }}
androidIconName="home"
/>
<NativeTabs.Trigger.TabBarLabel>Home</NativeTabs.Trigger.TabBarLabel>
</NativeTabs.Trigger>
SDK 54 API:
<NativeTabs.Trigger name="index">
<NativeTabs.Trigger.Icon sf="house.fill" md="home" />
<NativeTabs.Trigger.Label>Home</NativeTabs.Trigger.Label>
</NativeTabs.Trigger>
已知问题:在某些堆栈中推送屏幕时,透明的 NativeTabs 可能会闪烁白色。可以通过 ThemeProvider 设置背景色来缓解(参见 native-tabs 参考)。
当需要协调的玻璃过渡效果时,使用 @expo/ui:
import { Host, Namespace, Text } from '@expo/ui/swift-ui';
import { glassEffect, glassEffectID, padding } from '@expo/ui/swift-ui/modifiers';
const ns = new Namespace('glass');
<Host style={{ width: 220, height: 56 }}>
<Text
modifiers={[
padding({ all: 16 }),
glassEffect({ glass: { variant: 'regular' } }),
glassEffectID({ id: 'primary-chip', in: ns }),
]}
>
Explore
</Text>
</Host>;
在完成前将此视为必需步骤:
AccessibilityInfo.isReduceTransparencyEnabled() 并提供非玻璃降级方案。仅加载任务所需的内容:
references/expo-ui-swiftui.md:SwiftUI 组件映射、Host 布局、修饰符模式。references/native-tabs.md:原生标签页行为、迁移说明、已知问题。references/callstack-liquid-glass.md:Callstack 设置和兼容性权衡。references/apple-liquid-glass-design.md:符合 Apple 风格的组合、层次、动效和无障碍功能规则。如果请求是设计密集型(而非 API 密集型),请优先考虑本文档中的 Apple 视觉规则,然后从相关参考中提取 API 语法。
每周安装量
97
代码仓库
首次出现
2026年2月6日
安全审计
安装于
opencode91
codex90
gemini-cli90
github-copilot88
kimi-cli82
amp82
Ship Liquid Glass UI that feels native, stays legible, and degrades safely across iOS/Android.
expo-glass-effect and @expo/ui are not reliable in Expo Go on iOS.For tasks that involve significant visual design decisions, evaluate against these HIG buckets:
See references/apple-liquid-glass-design.md for practical design guidance. If a proposed style conflicts with HIG intent, prefer the HIG-consistent option.
| Path | Use It For | Tradeoffs |
|---|---|---|
expo-glass-effect | Most RN screens that need glass chips, floating buttons, toolbars, grouped controls | Best default in Expo; must guard runtime availability |
@expo/ui (Host + SwiftUI modifiers) | Native SwiftUI composition, advanced glass transitions, coordinated IDs/namespaces | iOS-family only, dev-build workflow, SwiftUI mental model |
expo-router/unstable-native-tabs | System-native Liquid Glass tab bars and iOS 26 nav behavior | Unstable API; syntax differs between SDK 54 and 55 |
@callstack/liquid-glass | Non-Expo RN or teams standardizing on Callstack package |
Combine paths when appropriate:
expo-glass-effect for floating controls inside screens.@expo/ui only where SwiftUI-specific behavior is required.Apply these rules before implementing visuals:
import { Platform, View } from 'react-native';
import { BlurView } from 'expo-blur';
import { GlassView, isGlassEffectAPIAvailable } from 'expo-glass-effect';
export function AdaptiveGlass({ style, children }) {
if (isGlassEffectAPIAvailable()) {
return (
<GlassView style={style} glassEffectStyle="regular" tintColor="#FFFFFF10">
{children}
</GlassView>
);
}
if (Platform.OS === 'ios') {
return (
<BlurView style={style} intensity={40} tint="dark">
{children}
</BlurView>
);
}
return <View style={[style, { backgroundColor: 'rgba(60,60,67,0.30)' }]}>{children}</View>;
}
expo-glass-effect UsageglassEffectStyle: 'regular' | 'clear' | 'identity' as needed.opacity < 1 on GlassView or parents.isInteractive as mount-time only. Remount using a key if it must change.GlassView.isGlassEffectAPIAvailable() before rendering.SDK 55+ compound API:
<NativeTabs.Trigger name="index">
<NativeTabs.Trigger.TabBarIcon
ios={{ default: 'house', selected: 'house.fill' }}
androidIconName="home"
/>
<NativeTabs.Trigger.TabBarLabel>Home</NativeTabs.Trigger.TabBarLabel>
</NativeTabs.Trigger>
SDK 54 API:
<NativeTabs.Trigger name="index">
<NativeTabs.Trigger.Icon sf="house.fill" md="home" />
<NativeTabs.Trigger.Label>Home</NativeTabs.Trigger.Label>
</NativeTabs.Trigger>
Known issue: transparent NativeTabs can flash white while pushing screens in some stacks. Mitigate by setting a background color via ThemeProvider (see native-tabs reference).
Use @expo/ui when coordinated glass transitions are needed:
import { Host, Namespace, Text } from '@expo/ui/swift-ui';
import { glassEffect, glassEffectID, padding } from '@expo/ui/swift-ui/modifiers';
const ns = new Namespace('glass');
<Host style={{ width: 220, height: 56 }}>
<Text
modifiers={[
padding({ all: 16 }),
glassEffect({ glass: { variant: 'regular' } }),
glassEffectID({ id: 'primary-chip', in: ns }),
]}
>
Explore
</Text>
</Host>;
Treat this as required before completion:
AccessibilityInfo.isReduceTransparencyEnabled() and provide non-glass fallback.Load only what is needed for the task:
references/expo-ui-swiftui.md: SwiftUI component mapping, Host layout, modifier patterns.references/native-tabs.md: Native tab behaviors, migration notes, known issues.references/callstack-liquid-glass.md: Callstack setup and compatibility tradeoffs.references/apple-liquid-glass-design.md: Apple-aligned composition, hierarchy, motion, and accessibility rules.If a request is design-heavy (not API-heavy), prioritize Apple visual rules in this file first, then pull API syntax from the relevant reference.
Weekly Installs
97
Repository
First Seen
Feb 6, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykPass
Installed on
opencode91
codex90
gemini-cli90
github-copilot88
kimi-cli82
amp82
Figma 设计系统构建技能 - 自动化生成专业级UI组件库与设计令牌
595 周安装
| iOS/tvOS focus; also requires fallbacks and runtime checks |