跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
设计与 UI

expo-ui

Library reference for @expo/ui SwiftUI components on iOS — covers Host boundaries, modifier composition, iOS 26 Liquid Glass and Human Interface Guidelines composition rules, layout/input/navigation/display catalogues, and ObservableState patterns. Use this skill whenever writing or reviewing React Native code that imports from @expo/ui/swift-ui or @expo/ui/swift-ui/modifiers — including new Expo apps adopting native SwiftUI views, migrations from React Native primitives to expo-ui, and code targeting iOS 26 features (Liquid Glass, GlassEffectContainer, sheet detents). Trigger even if the user does not explicitly mention "expo-ui" but is writing iOS-targeted Expo UI code that should bridge to SwiftUI.

pproenca · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add pproenca/dot-skills --skill expo-ui

技能说明


name: expo-ui description: Library reference for @expo/ui SwiftUI components on iOS — covers Host boundaries, modifier composition, iOS 26 Liquid Glass and Human Interface Guidelines composition rules, layout/input/navigation/display catalogues, and ObservableState patterns. Use this skill whenever writing or reviewing React Native code that imports from @expo/ui/swift-ui or @expo/ui/swift-ui/modifiers — including new Expo apps adopting native SwiftUI views, migrations from React Native primitives to expo-ui, and code targeting iOS 26 features (Liquid Glass, GlassEffectContainer, sheet detents). Trigger even if the user does not explicitly mention "expo-ui" but is writing iOS-targeted Expo UI code that should bridge to SwiftUI.

Expo @expo/ui SwiftUI Best Practices

Library reference for @expo/ui/swift-ui and @expo/ui/swift-ui/modifiers — the iOS surface of Expo's native UI bridge. Contains 53 rules across 8 categories, prioritised by cascade impact for agents building Expo apps that render to native SwiftUI views on iOS 26 and earlier.

When to Apply

Reference these guidelines when:

  • Building a new screen with @expo/ui/swift-ui — pick the right container (Form vs List vs ScrollView), wrap in Host correctly, apply modifiers
  • Migrating from React Native primitives (View, Text, TouchableOpacity) to native SwiftUI components
  • Targeting iOS 26 features — Liquid Glass material, GlassEffectContainer, new sheet detent behaviours
  • Reviewing code that imports from @expo/ui/swift-ui or @expo/ui/swift-ui/modifiers
  • Debugging "the SwiftUI view doesn't render / is the wrong size / ignores styles" — usually a Host or modifier issue
  • Composing presentation surfaces — Alert, ConfirmationDialog, BottomSheet, Popover — under HIG modality guidance
  • Writing controlled inputs (TextField, Toggle, Picker, Slider) with useNativeState and worklet writes

When NOT to Use This Skill

  • Android Jetpack Compose — this skill covers iOS SwiftUI only. The @expo/ui/jetpack-compose surface has its own conventions
  • Universal (cross-platform) components — @expo/ui exposes a small set; this skill scopes to the platform-specific iOS surface
  • Navigation routing — for stack/tab routing, use expo-router and expo-router/unstable-native-tabs; this skill covers UI composition only
  • Pre-iOS-17 fallbacks — most rules assume iOS 17 minimum; Liquid Glass rules require iOS 26

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Setup & Host BoundariesCRITICALhost-
2iOS 26 HIG Composition RulesCRITICALhig-
3Modifiers SystemCRITICALmod-
4Layout ComponentsHIGHlayout-
5Input & ControlsHIGHinput-
6Navigation & OverlaysHIGHnav-
7Display & FeedbackMEDIUM-HIGHdisplay-
8State & Cross-Cutting PatternsMEDIUMstate-

Quick Reference

1. Setup & Host Boundaries (CRITICAL)

  • host-wrap-all-swiftui-roots — Wrap every SwiftUI subtree in a Host
  • host-match-contents — Size Host to its SwiftUI content with matchContents
  • host-viewport-size-for-form — Use useViewportSizeMeasurement for Form and List
  • host-color-scheme-explicit — Pass explicit colorScheme when overriding the system
  • host-ignore-safe-area — Use ignoreSafeArea only for full-bleed surfaces

2. iOS 26 HIG Composition Rules (CRITICAL)

  • hig-glass-effect-container — Group glass siblings inside GlassEffectContainer
  • hig-no-glass-on-glass — Avoid nesting glassEffect on glass surfaces
  • hig-no-stacked-modals — Resolve a sheet before presenting another
  • hig-popover-iphone-fallback — Don't use Popover on iPhone — use BottomSheet
  • hig-sheet-detents-partial — Include a partial detent for Liquid Glass appearance
  • hig-confirmation-dialog-destructive — ConfirmationDialog + destructive role
  • hig-tint-only-for-brand — Reserve tint for brand surfaces, not destructive

3. Modifiers System (CRITICAL)

  • mod-prop-not-style — Modifiers go through the modifiers prop, not RN style
  • mod-composition-order — Modifier order is meaningful — each wraps the previous
  • mod-import-from-modifiers-subpath — Import from @expo/ui/swift-ui/modifiers
  • mod-frame-vs-fixedsize — frame proposes a size, fixedSize opts out of flex
  • mod-padding-vs-frame — padding for inner space, frame for outer bounds
  • mod-presentation-on-sheet-content — Presentation modifiers attach to sheet content
  • mod-disabled-prop — Use disabled modifier, don't conditionally render
  • mod-animation-wraps-trigger — withAnimation wraps state-driven prop changes

4. Layout Components (HIGH)

  • layout-hstack-vs-vstack — Pick stack direction by content flow
  • layout-lazy-stack-for-long-lists — LazyVStack inside ScrollView for long lists
  • layout-form-for-settings — Form adopts iOS grouped chrome automatically
  • [layout-section-with-header-footer](references/layout-section-with-h
阅读完整来源 ↗