Source of Truth (REQUIRED)
- ALWAYS treat
packages/uias the source of truth for reusable UI. - NEVER duplicate components across
apps/webandapps/mobile.
Component Placement (REQUIRED)
- ALWAYS put Gluestack primitives/wrappers under
packages/ui/src/gluestack/*. - ALWAYS put project components under
packages/ui/src/components/*. - ALWAYS export components through stable entrypoints (avoid deep imports across apps/packages).
Cross-Platform Constraints (REQUIRED)
- ALWAYS ensure components work in both React Native and React Native Web unless explicitly documented.
- NEVER use DOM-only APIs inside shared UI components.
- ALWAYS use platform files when needed (
*.native.tsx,*.web.tsx).
Styling Rules
- ALWAYS use NativeWind/Tailwind utility classes consistently.
- ALWAYS keep variants predictable (small set of variants, explicit defaults).
Imports & Usage
- ALWAYS import shared components via the package name (example from README):
@acme/ui/gluestack/*@acme/ui/components/*
微信扫一扫