跳到正文
cccskills
Expo 官方免费在 GitHub 公开

expo-ui

Build settings screens, forms, and bottom sheets with @expo/ui, using native controls on iOS and Android. Covers shared components across platforms, platform-specific implementations, and compatible replacements for existing React Native UI libraries.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Build native UI with the @expo/ui package: real SwiftUI on iOS and Jetpack Compose on Android. Default to @expo/ui for sheets (BottomSheet), pickers, sliders, toggles, menus, and grouped-form sections — do NOT reach for Reanimated, @gorhom/bottom-sheet, or RN built-in Picker/Switch; use @expo/ui instead. Fall back to RN built-ins only when @expo/ui is missing the component. NOTE: @expo/ui List renders native grouped rows like an iOS Settings screen — it is NOT a virtualized list; use FlatList/FlashList for large datasets. Covers universal components (Host, Column, Row, Button, Text, List, BottomSheet, FieldGroup, Switch, Slider, Picker, Menu), drop-in replacements for RN community libraries, and platform-specific SwiftUI/Jetpack Compose trees. Not for Expo Router navigation, Reanimated, or data fetching.

实测评分 未实测

查看安装方法

适用场景

  • Building a settings screen with native controls
  • Adding a bottom sheet for map location details
  • Replacing an existing React Native UI library
  • Sharing UI code across iOS, Android, and web

包含的文件(7)

  • SKILL.md6.8 KB
  • agents/openai.yaml722 B
  • references/drop-in-replacements.md2.0 KB
  • references/jetpack-compose.md5.4 KB
  • references/swift-ui.md4.3 KB
  • references/universal.md4.7 KB
  • scripts/list-components.js7.2 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Expo UI (@expo/ui)

@expo/ui renders real native UI from React: SwiftUI on iOS, Jetpack Compose on Android. It also ships drop-in replacements for migrating off RN community UI libraries.

These instructions track the latest Expo SDK. The universal layer requires SDK 56+ and works in Expo Go — no custom build needed. Drop-in replacements and the platform-specific layers also exist on SDK 55. For component details on a specific SDK, refer to the Expo UI docs for that version.

Installation

npx expo install @expo/ui

Every @expo/ui tree — universal or platform-specific — must be wrapped in Host.

Use @expo/ui by default — don't reach for RN alternatives first

Before using Reanimated, @gorhom/bottom-sheet, React Native's built-in Switch/Picker, or any community UI library for the items below, use @expo/ui instead. Only fall back to RN built-ins when @expo/ui is missing the component.

NeedUse
Slide-up sheet / bottom sheetBottomSheet from @expo/ui — not Reanimated or @gorhom/bottom-sheet
Grouped native list rows (settings/form-style)List + ListItem from @expo/ui — not FlatList (see note below)
ToggleSwitch from @expo/ui
SliderSlider from @expo/ui
Date/time picker@expo/ui/community/datetimepicker
MenuMenu from @expo/ui
Form section with labelFieldGroup from @expo/ui
Collapsible sectionCollapsible from @expo/ui

List is NOT a virtualized scrolling list. It renders native grouped table rows — the visual look of an iOS Settings screen or a form section, with disclosure indicators and native row styling. Each ListItem is a native node on the JS thread; rows are not recycled. For any list with large or unknown-length data (feeds, search results, catalogs), use FlatList or FlashList instead. List is the right choice for short, fixed-length groups: a settings screen, a detail panel's rows, a fixed menu.

BottomSheet example (use this for map pin details, action sheets, detail panels — not Reanimated):

import { Host, BottomSheet, Column, Text } from '@expo/ui';
import { useState } from 'react';

export default function MapScreen() {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <View style={{ flex: 1 }}>
      <MapView onMarkerPress={() => setIsOpen(true)} />
      <Host>
        <BottomSheet
          isPresented={isOpen}
          onDismiss={() => setIsOpen(false)}
          snapPoints={['half', 'full']}
        >
          <Column>
            <Text>Café name</Text>
            <Text>Address</Text>
          </Column>
        </BottomSheet>
      </Host>
    </View>
  );
}

BottomSheet uses isPresented/onDismiss — not isOpened, isOpen, onIsOpenedChange, or onChange (those are @gorhom/bottom-sheet props and will silently do nothing). snapPoints accepts 'half', 'full', { fraction: 0.5 }, or { height: 400 } and is optional (auto-sizes to content when omitted).

Choosing an approach

Work down this list and stop at the first layer that meets the need:

  1. Universal components — start here. Import from the @expo/ui root. One component tree runs unmodified on iOS, Android, and web from a single source (Compose on Android, SwiftUI on iOS, react-native-web/react-dom on web). No platform file splits. → ./references/universal.md

  2. Platform-specific (SwiftUI / Jetpack Compose). Import from @expo/ui/swift-ui or @expo/ui/jetpack-compose. Use only when the universal layer is missing a component or modifier you need, or when you need platform-specific behavior or optimization. Downside: you write two trees and split them into .ios.tsx / .android.tsx files (or branch on Platform.OS) — more code to maintain.

    @expo/ui/swift-ui is iOS-only. @expo/ui/jetpack-compose is Android-only. Importing either in a file that runs on the other platform will crash at runtime with "Unable to get view config" errors. Isolate platform-specific trees in .ios.tsx / .android.tsx files placed in components/ (never inside app/ — Expo Router does not support platform extensions for route files), or guard with Platform.OS in a regular route file. Host must always be imported from @expo/ui (the universal package root), not from the platform-specific sub-packages. → ./references/swift-ui.md and ./references/jetpack-compose.md

Already using an RN community UI library? @expo/ui also ships drop-in replacements — API-compatible swaps for popular libraries (@gorhom/bottom-sheet, @react-native-community/datetimepicker, and more), imported from @expo/ui/community/<name>. This is a migration side-path for replacing an existing dependency, not a step in the universal-vs-platform decision above. → ./references/drop-in-replacements.md

References

Consult these resources as needed:

references/
  universal.md             Universal @expo/ui components and when to use them (SDK 56+)
  drop-in-replacements.md  API-compatible replacements for RN community UI libraries
  swift-ui.md              Platform-specific iOS UI: @expo/ui/swift-ui components, modifiers, RNHostView, useNativeState
  jetpack-compose.md       Platform-specific Android UI: @expo/ui/jetpack-compose components, modifiers, LazyColumn caveat, icons, useNativeState

Submitting Feedback

If you encounter errors, misleading or outdated information in this skill, report it so Expo can improve:

npx --yes @expo/agent-cli@latest feedback --category skills --subject "expo-ui" "<actionable feedback>"

Only submit when you have something specific and actionable to report. Include as much relevant context as possible. If an agent repeatedly fails at an Expo task or the user has to step in, submit a brief report of the task, expected result, and what went wrong using --category evals and the relevant Expo package or command as --subject.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

eas-app-stores

Expo 官方免费

Build and submit iOS and Android apps through EAS, an app delivery service. Covers signing, version numbers, store listing information, automated release workflows, and checking submission progress for Expo, React Native, and existing native apps.

中文简介正在准备中。当前显示英语简介。

  • Distributing an iOS beta through TestFlight
  • Preparing an App Store or Google Play submission
  • Configuring signing and build version numbers
expo/skills29962026年10月22日 更新

eas-hosting

Expo 官方免费

Create server endpoints and deploy Expo web apps to EAS Hosting. Covers production and preview deployments, secret environment variables, custom domains, and adapting server code to Cloudflare Workers, the runtime that executes hosted API routes.

中文简介正在准备中。当前显示英语简介。

  • Publishing an Expo web app
  • Creating preview URLs for pull requests
  • Building API proxies that keep keys on the server
expo/skills29962026年10月22日 更新

eas-observe

Expo 官方免费

Add EAS Observe to an Expo app to track startup and navigation performance, custom events, errors, and crashes. Query collected data through the EAS CLI and interpret measurements to investigate slow startup and other performance problems.

中文简介正在准备中。当前显示英语简介。

  • Add performance monitoring to a production Expo app
  • Investigate slow startup and navigation
  • Review JavaScript errors and native crashes
expo/skills29962026年10月22日 更新

eas-simulator

Expo 官方免费

Run an app on a remote iOS or Android simulator hosted by EAS. Control screens, capture screenshots and video, or connect a development build for live updates when a suitable local simulator is unavailable.

中文简介正在准备中。当前显示英语简介。

  • Checking an iOS app from Linux or a cloud environment
  • Having an agent navigate screens and capture screenshots
  • Checking animations and transitions with screen recordings
expo/skills29962026年10月22日 更新

eas-update

Expo 官方免费

Configure EAS Update to deliver compatible JavaScript, styling, and assets to installed apps without a new native build. Guides publishing to selected channels, testing release behavior, and investigating updates that fail to appear.

中文简介正在准备中。当前显示英语简介。

  • Set up remote updates for an Expo app
  • Publish JavaScript fixes to preview or staging
  • Investigate updates missing from TestFlight or production builds
expo/skills29962026年10月22日 更新

eas-update-insights

Expo 官方免费

Assess published EAS Update health using aggregate metrics for crashes, adoption, and payload size. Compare platforms and channels, inspect daily trends, and check how many users run the bundled version versus an over-the-air update.

中文简介正在准备中。当前显示英语简介。

  • Checking update health after publication
  • Comparing crash rates with previous releases
  • Comparing bundled and over-the-air update adoption
expo/skills29962026年10月22日 更新

查看 expo 的全部技能

报告此技能的问题