expo-ui-jetpack-compose
它能做什么
这个工具让你可以直接在 Expo 中,使用名为 Jetpack Compose 的技术为 Android 应用创建视觉界面。它可以帮助你构建按钮和文本等元素,并遵循 Android 的视觉风格。
适用场景
- ✓你想在 Expo 中构建 Android 应用的视觉部分时。
- ✓你需要使用 Android 专属的视觉组件时。
- ✓你正在使用 Expo SDK 55 版本时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/expo-ui-jetpack-compose/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“创建一个文字为“Click me”的按钮,按下时弹出提示框。”
每周 5 个新技能,1 分钟读完。
工作原理
该工具使用的指令与 Jetpack Compose 相似,它是构建 Android 界面的一种现代方式。你需要选择视觉组件以及它们的排列方式,并且所有内容都要放在一个 `Host` 容器中,才能正常运行。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
The instructions in this skill apply to SDK 55 only. For other SDK versions, refer to the Expo UI Jetpack Compose docs for that version for the most accurate information.
When to Use
- You need to build Android-native UI in Expo using
@expo/ui/jetpack-compose. - The task involves choosing Compose views or modifiers, embedding them in
Host, or translating Jetpack Compose patterns into Expo UI code. - You are working specifically against Expo SDK 55 behavior for Jetpack Compose integration.
Installation
npx expo install @expo/ui
A native rebuild is required after installation (npx expo run:android).
Instructions
- Expo UI's API mirrors Jetpack Compose's API. Use Jetpack Compose and Material Design 3 knowledge to decide which components or modifiers to use.
- Components are imported from
@expo/ui/jetpack-compose, modifiers from@expo/ui/jetpack-compose/modifiers. - When about to use a component, fetch its docs to confirm the API - https://docs.expo.dev/versions/v55.0.0/sdk/ui/jetpack-compose/{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/jetpack-compose/modifiers/index.md
- Every Jetpack Compose tree must be wrapped in
Host. Use<Host matchContents>for intrinsic sizing, or<Host style={{ flex: 1 }}>when you need explicit size (e.g. as a parent ofLazyColumn). Example:
import { Host, Column, Button, Text } from "@expo/ui/jetpack-compose";
import { fillMaxWidth, paddingAll } from "@expo/ui/jetpack-compose/modifiers";
<Host matchContents>
<Column verticalArrangement={{ spacedBy: 8 }} modifiers={[fillMaxWidth(), paddingAll(16)]}>
<Text style={{ typography: "titleLarge" }}>Hello</Text>
<Button onPress={() => alert("Pressed!")}>Press me</Button>
</Column>
</Host>;
Key Components
- LazyColumn — Use for a Compose-native list when the platform-specific design calls for it; do not replace React Native lists universally. Wrap in
<Host style={{ flex: 1 }}>. - Icon — Use
<Icon source={require('./icon.xml')} size={24} />with Android XML vector drawables from Material Symbols.
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.
常见问题
什么是 Jetpack Compose?
它是一种现代且更简洁的方式,用于为 Android 应用创建视觉界面。
什么是 `Host`?
它是 Jetpack Compose 视觉元素在 Expo 中运行时必需的容器。
需要安装什么东西吗?
需要。你需要安装 `@expo/ui` 包,然后运行 `npx expo run:android` 让更改生效。
详情
作者的原始描述
Build Android-native Expo SDK 55 UI with Jetpack Compose views/modifiers, Host sizing and platform-specific integration.
热度
- GitHub 星标
- 48k
- 排名
- #4578
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。