expo-ui

โดย expo

Framework (OSS). สร้าง UI ดั้งเดิมด้วยแพ็คเกจ @expo/ui: SwiftUI จริงบน iOS และ Jetpack Compose บน Android ที่เรนเดอร์จาก React ในแอป Expo หรือ React Native ครอบคลุมคอมโพเนนต์ข้ามแพลตฟอร์มสากล (Host, Column, Row, Button, Text, List และอื่นๆ ที่นำเข้าจาก @expo/ui), การแทนที่แบบดรอปอินสำหรับไลบรารีชุมชน React Native ยอดนิยม (BottomSheet, DateTimePicker, Slider, Menu ฯลฯ) และ SwiftUI เฉพาะแพลตฟอร์ม (@expo/ui/swift-ui, iOS เท่านั้น) และ Jetpack Compose...

npx skills add https://github.com/expo/skills --skill expo-ui

Expo UI (@expo/ui)

@expo/ui renders real native UI from React: SwiftUI on iOS, Jetpack Compose on Android. Start with its universal components (one tree for iOS, Android, and web) and drop to platform-specific SwiftUI/Jetpack Compose only when the universal layer falls short. 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+. 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

On SDK 56, @expo/ui works in Expo Go, so npx expo start runs it directly — no custom build required. On older SDKs, build a dev client first (npx expo run:ios / npx expo run:android).

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

Choosing an approach (read this first)

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 submit-expo-feedback@latest --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.

Skills เพิ่มเติมจาก expo

expo-upgrade
expo
เฟรมเวิร์ก (โอเพนซอร์ส) แนวทางการอัปเกรดเวอร์ชัน Expo SDK และแก้ไขปัญหาการพึ่งพา
apidevelopmentofficial
expo-data-fetching
expo
Framework (OSS). 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`).
official
android-e2e-testing
expo
ทดสอบฟีเจอร์ Expo Router บนอีมูเลเตอร์ Android โดยใช้ ADB ใช้หลังจากที่ได้ใช้งานฟีเจอร์เนทีฟ Android หรือเมื่อต้องการตรวจสอบพฤติกรรม UI บน Android
official
expo-dev-client
expo
สร้าง Expo development clients แบบกำหนดเองสำหรับทดสอบโค้ดเนทีฟบนอุปกรณ์จริงผ่าน EAS Build หรือในเครื่อง จำเป็นเมื่อใช้โมดูลเนทีฟที่กำหนดเอง, เป้าหมาย Apple (วิดเจ็ต, app clips), หรือโค้ดเนทีฟของบุคคลที่สามที่ไม่มีใน Expo Go; ลองใช้ Expo Go ก่อนด้วย npx expo start รองรับการ build บนคลาวด์พร้อมส่ง TestFlight อัตโนมัติหรือ build ในเครื่องบนเครื่องของคุณ โดยสร้างไฟล์ .ipa (iOS) หรือ .apk / .aab (Android) ต้องกำหนดค่า eas.json ด้วยโปรไฟล์ development ที่ตั้งค่า...
official
expo-tailwind-setup
expo
สไตล์ Tailwind CSS v4 สากลสำหรับแอป Expo บน iOS, Android และ Web รวม Tailwind CSS v4 กับ react-native-css และ NativeWind v5 ผ่าน Metro transformer โดยไม่ต้องกำหนดค่า Babel มีไลบรารีคอมโพเนนต์ที่ห่อหุ้มด้วย CSS (View, Text, ScrollView, Pressable, TextInput, Image, Link) ที่ใช้สไตล์ className กับองค์ประกอบดั้งเดิม รองรับการจัดสไตล์เฉพาะแพลตฟอร์มผ่าน CSS media queries, ตัวแปรธีมที่กำหนดเองผ่านบล็อก @theme และความหมายของ Apple...
official
android-jetpack-compose
expo
ใช้เมื่อสร้าง UI ของ Android ด้วย Jetpack Compose จัดการสถานะด้วย remember/mutableStateOf หรือใช้รูปแบบ UI แบบประกาศ
official
swiftui-expert-skill
expo
เขียน ตรวจสอบ หรือปรับปรุงโค้ด SwiftUI ตามแนวทางปฏิบัติที่ดีที่สุดสำหรับการจัดการสถานะ การประกอบวิว ประสิทธิภาพ API เฉพาะของ macOS และ iOS 26+ Liquid…
official
eas-update-insights
expo
ตรวจสอบสถานะของ EAS Updates ที่เผยแพร่แล้ว: อัตราการขัดข้อง, จำนวนการติดตั้ง/เปิดใช้งาน, ผู้ใช้ที่ไม่ซ้ำ, ขนาด payload, และการแบ่งระหว่างผู้ใช้แบบฝังและ OTA ต่อ…
official