Communitygithub.com

expo/expo-ui

フレームワーク(OSS)。`@expo/ui` パッケージを使って本当のネイティブUIを構築:iOS では SwiftUI、Android では Jetpack Compose。シート、ピッカー、スライダー、トグル、メニュー、グループ化されたフォームセクションはデフォルトで `@expo/ui` を使用し、Reanimated や @gorhom/bottom-sheet、RN 組み込みの Picker/Switch には手を出さない。

expo-ui とは?

このスキルは、`@expo/ui` パッケージを使用して、React から真のネイティブ UI をレンダリングする方法を開発者に指示します。iOS では SwiftUI、Android では Jetpack Compose を利用し、SDK 56 以上では Expo Go で追加ビルドなしで動作します。主な目的は、`BottomSheet`、`Switch`、`Slider`、`Picker`、`Menu`、`FieldGroup` などの一般的な UI コンポーネントに対して、Reanimated や @gorhom/bottom-sheet などのコミュニティライブラリではなく、`@expo/ui` をデフォルトで使用するよう促すことです。また、`@gorhom/bottom-sheet` や `@react-native-community/datetimepicker` などの有名な RN コミュニティ UI ライブラリのドロップイン代替も提供します。注意点として、`@expo/ui` の `List` はネイティブのグループ化されたテーブル行をレンダリングしますが、仮想化されていないため、大規模なデータセットには適しておらず、`FlatList` や `FlashList` の使用が推奨されます。このスキルは、VSCode、Cursor、Claude Code、GitHub Copilot などの AI エージェントツールで使用することを想定しています。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/expo/skills/tree/main/plugins/expo/skills/expo-ui

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Expo UI (@expo/ui)

@expo/ui は React から本当のネイティブ UI をレンダリングします。iOS では SwiftUI、Android では Jetpack Compose です。また、RN コミュニティ UI ライブラリからの移行のためのドロップイン代替も提供します。

これらの手順は最新の Expo SDK を追跡しています。ユニバーサル レイヤーは SDK 56+ が必要で、Expo Go で動作します。カスタムビルドは不要です。ドロップイン代替とプラットフォーム固有のレイヤーは SDK 55 にも存在します。特定の SDK のコンポーネントの詳細については、そのバージョンの Expo UI ドキュメントを参照してください。

インストール

npx expo install @expo/ui

すべての @expo/ui ツリー(ユニバーサルまたはプラットフォーム固有)は、Host でラップする必要があります。

デフォルトで @expo/ui を使用 — 最初から RN の代替に手を出さない

以下のアイテムに対して、Reanimated、@gorhom/bottom-sheet、React Native の組み込み Switch/Picker、またはコミュニティ UI ライブラリを使用する前に、代わりに @expo/ui を使用してください。 @expo/ui にコンポーネントがない場合のみ、RN の組み込みにフォールバックしてください。

必要なもの使用するもの
スライドアップシート / ボトムシート@expo/ui の BottomSheet — Reanimated や @gorhom/bottom-sheet は使用しない
グループ化されたネイティブリスト行(設定/フォームスタイル)@expo/ui の List + ListItem — FlatList は使用しない(以下の注釈を参照)
トグル@expo/ui の Switch
スライダー@expo/ui の Slider
日付/時刻ピッカー@expo/ui/community/datetimepicker
メニュー@expo/ui の Menu
ラベル付きフォームセクション@expo/ui の FieldGroup
折りたたみ可能セクション@expo/ui の Collapsible

List は仮想化されたスクロールリストではありません。 ネイティブのグループ化されたテーブル行をレンダリングします — iOS の設定画面やフォームセクションのような見た目で、開示インジケーターとネイティブの行スタイルが付いています。各 ListItem は JS スレッド上のネイティブノードです。行は再利用されません。大きなデータや長さが不明なリスト(フィード、検索結果、カタログ)には、代わりに FlatList または FlashList を使用してください。List は短く固定長のグループに適しています:設定画面、詳細パネルの行、固定メニューなどです。

BottomSheet の例(マップピンの詳細、アクションシート、詳細パネルにはこちらを使用 — 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 は isPresented/onDismiss を使用します — isOpened、isOpen、onIsOpenedChange、onChange ではありません(これらは @gorhom/bottom-sheet の props であり、黙って何も行いません)。snapPoints は 'half'、'full'、{ fraction: 0.5 }、または { height: 400 } を受け入れ、オプションです(省略時はコンテンツに合わせて自動サイズ調整されます)。

アプローチの選択

このリストを上から順に確認し、ニーズを満たす最初のレイヤーで停止してください:

  1. ユニバーサルコンポーネント — ここから始めてください。 @expo/ui のルートからインポートします。1つのコンポーネントツリーが、単一のソースから iOS、Android、Web で変更なしで動作します(Android では Compose、iOS では SwiftUI、Web では react-native-web/react-dom)。プラットフォームファイルの分割は不要です。→ ./references/universal.md

  2. プラットフォーム固有(SwiftUI / Jetpack Compose) @expo/ui/swift-ui または @expo/ui/jetpack-compose からインポートします。ユニバーサルレイヤーに必要なコンポーネントやモディファイアがない場合、またはプラットフォーム固有の動作や最適化が必要な場合にのみ使用します。欠点: 2つのツリーを記述し、.ios.tsx / .android.tsx ファイルに分割する(または Platform.OS で分岐する)必要があります — 保守すべきコードが増えます。

    @expo/ui/swift-ui は iOS 専用です。@expo/ui/jetpack-compose は Android 専用です。 別のプラットフォームで実行されるファイルでこれらのいずれかをインポートすると、実行時に「Unable to get view config」エラーでクラッシュします。プラットフォーム固有のツリーは components/ に配置した .ios.tsx / .android.tsx ファイルで分離するか(app/ 内には決して配置しないでください — Expo Router はルートファイルのプラットフォーム拡張子をサポートしていません)、通常のルートファイルで Platform.OS でガードしてください。Host は常に @expo/ui(ユニバーサルパッケージルート)からインポートする必要があり、プラットフォーム固有のサブパッケージからはインポートしません。→ ./references/swift-ui.md および ./references/jetpack-compose.md

すでに RN コミュニティ UI ライブラリを使用していますか? @expo/ui はドロップイン代替も提供します — @gorhom/bottom-sheet、@react-native-community/datetimepicker などの人気ライブラリの API 互換の交換品で、@expo/ui/community/<name> からインポートできます。これは既存の依存関係を置き換えるための移行補助パスであり、上記のユニバーサル vs プラットフォームの判断のステップではありません。→ ./references/drop-in-replacements.md

参考資料

必要に応じてこれらのリソースを参照してください:

references/
  universal.md             ユニバーサルな @expo/ui コンポーネントとその使用場面(SDK 56+)
  drop-in-replacements.md  RN コミュニティ UI ライブラリの API 互換の代替品
  swift-ui.md              プラットフォーム固有の iOS UI: @expo/ui/swift-ui コンポーネント、モディファイア、RNHostView、useNativeState
  jetpack-compose.md       プラットフォーム固有の Android UI: @expo/ui/jetpack-compose コンポーネント、モディファイア、LazyColumn の注意点、アイコン、useNativeState

フィードバックの送信

エラーや、このスキルに誤解を招く情報や古い情報があった場合は、Expo が改善できるよう報告してください:

npx --yes submit-expo-feedback@latest --category skills --subject "expo-ui" "<具体的で実行可能なフィードバック>"

具体的で実行可能な報告事項がある場合にのみ送信してください。可能な限り多くの関連コンテキストを含めてください。 AI エージェントが繰り返し失敗した場合や、ユーザーが Expo のタスクを引き継がなければならなかった場合は、代わりに expo-skill-feedback スキルを読み込み、その評価候補フローに従ってください。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

expo/add-app-clip

Add an iOS App Clip target to an Expo app. Use when the user mentions App Clip, AASA, apple-app-site-association, appclips, smart app banner, or wants to ship a lightweight iOS Clip invoked from a URL alongside their parent app.

expo/building-native-ui

Complete guide for building beautiful apps with Expo Router. Covers fundamentals, styling, components, navigation, animations, patterns, and native tabs.

expo/eas-update-insights

Check the health of published EAS Updates: crash rates, install/launch counts, unique users, payload size, and the split between embedded and OTA users per channel. Use when the user asks how an update is performing, whether a rollout is healthy, how many users are on the embedded build vs OTA, or wants to gate CI on update health.

expo/expo-api-routes

Guidelines for creating API routes in Expo Router with EAS Hosting

expo/expo-brownfield

Integrate Expo and React Native into an existing native iOS or Android app. Use when the user mentions brownfield, embedding React Native in a native app, AAR/XCFramework, or adding Expo to an existing Kotlin/Swift project. Covers both the isolated approach and the integrated approach.

expo/expo-cicd-workflows

Helps understand and write EAS workflow YAML files for Expo projects. Use this skill when the user asks about CI/CD or workflows in an Expo or EAS context, mentions .eas/workflows/, or wants help with EAS build pipelines or deployment automation.

expo/expo-deployment

Deploying Expo apps to iOS App Store, Android Play Store, web hosting, and API routes

expo/expo-dev-client

Build and distribute Expo development clients locally or via TestFlight

expo/expo-examples

Framework (OSS). Expo's official example projects - the expo/examples repo of ~70 `with-*` integrations (Stripe, Clerk, Supabase, OpenAI, maps, Reanimated, SQLite, Skia, NativeWind, and more). Use when integrating a third-party library or service into an existing Expo app and you want the canonical, version-matched pattern to adapt, or when scaffolding a new project from one with `npx create-expo --example`.

expo/expo-module

Guide for creating and writing Expo native modules and views using the Expo Modules API (Swift, Kotlin, TypeScript). Covers module definition DSL, native views, shared objects, config plugins, lifecycle hooks, autolinking, and type system. Use when building or modifying native modules for Expo.

expo/expo-observe

Use for anything related to EAS Observe — adding `expo-observe` to an Expo project (AppMetricsRoot/ObserveRoot HOC, markInteractive, the useObserve hook, and the Expo Router / React Navigation integrations for per-route metrics), querying via the EAS CLI (`eas observe:metrics-summary`, `observe:metrics`, `observe:routes`, `observe:events`, `observe:versions`), or interpreting the resulting metrics (cold/warm launch, TTR, TTI, navigation cold/warm TTR, update download, and the TTI frameRate params for triaging slow startups).

expo/expo-overview

Framework (OSS). Entry point and router for every Expo or EAS task. Load this skill first — before writing code and before choosing another expo-* / eas-* skill — when the request, PRD, or spec mentions Expo, EAS, Expo Go, or an expo-* package, or the project has an `expo` dependency in `package.json`. Within that gate it also covers app specs and designs to implement (tabs, stacks, maps, lists, navigation, building from a screenshot), and phrasings like 'implement a mobile app', 'make my app look native', 'add navigation', 'fetch some data', 'upgrade my SDK', 'add Expo to my existing native app', 'ship to the App Store', or 'I'm new to Expo, where do I start'. A fully specified request (SDK pinned, libraries named, layout given) still routes through here — the shared setup rules still apply. Do NOT load it when neither signal is present: a bare React Native project with no `expo` dependency is not Expo work. Detects the real goal, routes to the right expo-* / eas-* skill, and owns the shared setup rules.

expo/expo-router

Framework (OSS). Navigation and routing for Expo Router. Covers file-based routes, groups and dynamic routes, folder organization, Link with previews and context menus, native Stack, page titles, modals and form sheets, NativeTabs, headers and toolbars, and header search bars.

expo/expo-skill-eval

Evaluate Expo skills in this repo end-to-end - trigger accuracy, generated code quality, and runtime screenshots on iOS simulator and Android emulator via Expo Go (web optional). Use when the user wants to eval an Expo skill, test that a skill produces working code, benchmark a skill with device screenshots, or verify a skill's output renders correctly.

expo/expo-tailwind-setup

Set up Tailwind CSS v4 in Expo with react-native-css and NativeWind v5 for universal styling

expo/expo-ui-jetpack-compose

`@expo/ui/jetpack-compose` package lets you use Jetpack Compose Views and modifiers in your app.

expo/expo-ui-swiftui

`@expo/ui/swift-ui` package lets you use SwiftUI Views and modifiers in your app.

expo/expo-upgrade

Framework (OSS). Guidelines for upgrading Expo SDK versions and fixing dependency issues

expo/native-data-fetching

Use when implementing or debugging ANY network request, API call, or data fetching. Covers fetch API, React Query, SWR, error handling, caching, offline support, and Expo Router data loaders (`useLoaderData`).

expo/skills

Build and submit iOS and Android apps with EAS to TestFlight, the App Store, or Google Play. Supports Expo and other React Native projects, plus existing native apps. Use for eas.json setup, release pipelines, signing, app versions and build numbers, store submissions, and listing metadata. For Expo websites and API routes, use eas-hosting; for adding React Native screens to a native app, use expo-brownfield.

関連スキル