expo-ui-swift-ui
它能做什么
这个工具可以使用 SwiftUI 为 Expo 应用构建可视化界面。SwiftUI 是 iOS 原生的界面框架。你可以把 SwiftUI 的视觉元素和 React Native 组件结合在一起使用。
适用场景
- ✓当你想为 iPhone/iPad 上的 Expo 应用制作可视化部分时。
- ✓当你想把 SwiftUI 视觉元素与 React Native 部分混合使用时。
- ✓如果你使用的是 Expo 55 版本,并且想用更高级的视觉功能时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/expo-ui-swift-ui/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“为我的 Expo 应用用 SwiftUI 创建一个登录页面,包含邮箱和密码输入框,以及一个登录按钮。”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具基于 iOS 的 SwiftUI 框架,并与 Expo 连接起来。你用 SwiftUI 编写视觉代码,工具会确保它在你的 Expo 应用中正常运行,同时也允许你加入 React Native 组件。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
The instructions in this skill apply to SDK 55 only. For other SDK versions, refer to the Expo UI SwiftUI docs for that version for the most accurate information.
When to Use
- You need to build iOS-native UI in Expo using
@expo/ui/swift-ui. - The task involves selecting SwiftUI views or modifiers, wrapping trees in
Host, or embedding React Native components withRNHostView. - You are targeting Expo SDK 55 behavior for SwiftUI integration and extension guidance.
Installation
npx expo install @expo/ui
A native rebuild is required after installation (npx expo run:ios).
Instructions
- Expo UI's API mirrors SwiftUI's API. Use SwiftUI knowledge to decide which components or modifiers to use.
- Components are imported from
@expo/ui/swift-ui, modifiers from@expo/ui/swift-ui/modifiers. - When about to use a component, fetch its docs to confirm the API - https://docs.expo.dev/versions/v55.0.0/sdk/ui/swift-ui/{component-name}/index.md
- When unsure about a modifier's API, refer to the docs - https://docs.expo.dev/versions/v55.0.0/sdk/ui/swift-ui/modifiers/index.md
- Every SwiftUI tree must be wrapped in
Host. RNHostViewis specifically for embedding RN components inside a SwiftUI tree. Example:
import { Host, VStack, RNHostView } from "@expo/ui/swift-ui";
import { Pressable } from "react-native";
<Host matchContents>
<VStack>
<RNHostView matchContents>
{/* Pressable is a React Native component, embedded through RNHostView. */}
<Pressable />
</RNHostView>
</VStack>
</Host>;
- If a required modifier or View is missing in Expo UI, it can be extended via a local Expo module. See: https://docs.expo.dev/guides/expo-ui-swift-ui/extending/index.md. Confirm with the user before extending.
Limitations
- APIs target SDK 55; check that version’s actual Expo docs and installed package before editing. Android/iOS examples are platform-specific, not interchangeable or proof of real-device behavior. Existing framework and user requirements take precedence.
- Native rebuilds install/execute dependencies and change the project; review the intended development target first. icon.xml and app code are application assets, not bundled files.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
常见问题
使用这个技能需要会 Swift 编程吗?
了解 SwiftUI 会有帮助,因为这个工具的接口与 SwiftUI 保持一致。不过你可以查阅文档,学习各个组件的用法。
这个工具能在 Android 上用吗?
这个工具专注于使用 SwiftUI 构建原生 iOS 界面。如果是 Android,你需要使用标准的 React Native 组件。
“Host”和“RNHostView”是什么?
“Host”是让 SwiftUI 元素在 Expo 中正常工作所必需的容器。“RNHostView”专门用于在 SwiftUI 构建的结构中放置 React Native 组件。
详情
作者的原始描述
Build iOS-native Expo SDK 55 UI with SwiftUI views/modifiers, Host/RNHostView embedding and native rebuild prerequisites.
热度
- GitHub 星标
- 48k
- 排名
- #4579
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。