@jhm1909/ag-kit 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/ARCHITECTURE.md +189 -0
- package/.agent/known-registries.json +181 -0
- package/.agent/mcp_config.json +19 -0
- package/.agent/rules/clean-code.md +107 -0
- package/.agent/rules/documents.md +177 -0
- package/.agent/rules/git-workflow.md +68 -0
- package/.agent/rules/nano-banana.md +46 -0
- package/.agent/rules/research.md +35 -0
- package/.agent/rules/skill-loading.md +100 -0
- package/.agent/rules/skill-suggestion.md +47 -0
- package/.agent/rules/testing.md +52 -0
- package/.agent/rules/workflow-advisor.md +108 -0
- package/.agent/rules/workflow-skill-convention.md +127 -0
- package/.agent/skills/ai-engineer/SKILL.md +824 -0
- package/.agent/skills/ai-engineer/references/agentic-patterns.md +329 -0
- package/.agent/skills/ai-engineer/references/evaluation.md +493 -0
- package/.agent/skills/ai-engineer/references/llm.md +490 -0
- package/.agent/skills/ai-engineer/references/rag-advanced.md +444 -0
- package/.agent/skills/ai-engineer/references/serving-optimization.md +531 -0
- package/.agent/skills/ai-engineer/vector-db/README.md +137 -0
- package/.agent/skills/app-builder/SKILL.md +75 -0
- package/.agent/skills/app-builder/agent-coordination.md +71 -0
- package/.agent/skills/app-builder/feature-building.md +53 -0
- package/.agent/skills/app-builder/project-detection.md +34 -0
- package/.agent/skills/app-builder/scaffolding.md +118 -0
- package/.agent/skills/app-builder/tech-stack.md +41 -0
- package/.agent/skills/app-builder/templates/SKILL.md +39 -0
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
- package/.agent/skills/backend-developer/SKILL.md +763 -0
- package/.agent/skills/backend-developer/references/general-patterns.md +65 -0
- package/.agent/skills/backend-developer/references/go-echo.md +68 -0
- package/.agent/skills/backend-developer/references/go-gin.md +76 -0
- package/.agent/skills/backend-developer/references/java-springboot.md +83 -0
- package/.agent/skills/backend-developer/references/node-express.md +64 -0
- package/.agent/skills/backend-developer/references/node-nestjs.md +69 -0
- package/.agent/skills/backend-developer/references/python-django.md +67 -0
- package/.agent/skills/backend-developer/references/python-fastapi.md +80 -0
- package/.agent/skills/blockchain-engineer/SKILL.md +975 -0
- package/.agent/skills/blockchain-engineer/references/deployment.md +28 -0
- package/.agent/skills/blockchain-engineer/references/evm.md +14 -0
- package/.agent/skills/blockchain-engineer/references/mechanisms.md +32 -0
- package/.agent/skills/blockchain-engineer/references/solidity.md +32 -0
- package/.agent/skills/business-analysis/SKILL.md +85 -0
- package/.agent/skills/business-analysis/references/best-practices/diagrams.md +141 -0
- package/.agent/skills/business-analysis/references/domains/ai-agent.md +94 -0
- package/.agent/skills/business-analysis/references/domains/blockchain-dapp.md +86 -0
- package/.agent/skills/business-analysis/references/domains/ecommerce.md +77 -0
- package/.agent/skills/business-analysis/references/domains/education.md +42 -0
- package/.agent/skills/business-analysis/references/domains/fintech.md +44 -0
- package/.agent/skills/business-analysis/references/domains/fnb.md +82 -0
- package/.agent/skills/business-analysis/references/domains/healthtech.md +44 -0
- package/.agent/skills/business-analysis/references/domains/internal-tools.md +38 -0
- package/.agent/skills/business-analysis/references/domains/marketplace.md +52 -0
- package/.agent/skills/business-analysis/references/domains/saas.md +36 -0
- package/.agent/skills/business-analysis/references/workflows/collaboration.md +41 -0
- package/.agent/skills/business-analysis/scripts/verify_mermaid.py +86 -0
- package/.agent/skills/business-analysis/templates/brd.md +46 -0
- package/.agent/skills/business-analysis/templates/change-request.md +41 -0
- package/.agent/skills/business-analysis/templates/prd-functional.md +38 -0
- package/.agent/skills/business-analysis/templates/use-case.md +40 -0
- package/.agent/skills/business-analysis/templates/user-story-detailed.md +36 -0
- package/.agent/skills/code-review/SKILL.md +113 -0
- package/.agent/skills/code-review/references/code-review-reception.md +209 -0
- package/.agent/skills/code-review/references/differential_review.md +59 -0
- package/.agent/skills/code-review/references/requesting-code-review.md +105 -0
- package/.agent/skills/code-review/references/spec_compliance.md +43 -0
- package/.agent/skills/code-review/references/verification-before-completion.md +139 -0
- package/.agent/skills/context-engineering/SKILL.md +68 -0
- package/.agent/skills/context-engineering/references/context-compression.md +84 -0
- package/.agent/skills/context-engineering/references/context-degradation.md +93 -0
- package/.agent/skills/context-engineering/references/context-fundamentals.md +75 -0
- package/.agent/skills/context-engineering/references/context-optimization.md +82 -0
- package/.agent/skills/context-engineering/references/evaluation.md +89 -0
- package/.agent/skills/context-engineering/references/memory-systems.md +88 -0
- package/.agent/skills/context-engineering/references/multi-agent-patterns.md +90 -0
- package/.agent/skills/context-engineering/references/project-development.md +97 -0
- package/.agent/skills/context-engineering/references/tool-design.md +86 -0
- package/.agent/skills/debugging/SKILL.md +60 -0
- package/.agent/skills/debugging/references/defense-in-depth.md +130 -0
- package/.agent/skills/debugging/references/root-cause-tracing.md +177 -0
- package/.agent/skills/debugging/references/systematic-debugging.md +295 -0
- package/.agent/skills/debugging/references/verification-before-completion.md +142 -0
- package/.agent/skills/designer/SKILL.md +159 -0
- package/.agent/skills/designer/concepts/apple-glass.md +48 -0
- package/.agent/skills/designer/concepts/aurora-gradients.md +26 -0
- package/.agent/skills/designer/concepts/bento-grids.md +14 -0
- package/.agent/skills/designer/concepts/claymorphism.md +27 -0
- package/.agent/skills/designer/concepts/neo-brutalism.md +32 -0
- package/.agent/skills/designer/data/app-interface.csv +31 -0
- package/.agent/skills/designer/data/charts.csv +26 -0
- package/.agent/skills/designer/data/colors.csv +162 -0
- package/.agent/skills/designer/data/design.csv +1776 -0
- package/.agent/skills/designer/data/icons.csv +106 -0
- package/.agent/skills/designer/data/landing.csv +35 -0
- package/.agent/skills/designer/data/products.csv +162 -0
- package/.agent/skills/designer/data/react-performance.csv +45 -0
- package/.agent/skills/designer/data/styles.csv +85 -0
- package/.agent/skills/designer/data/typography.csv +74 -0
- package/.agent/skills/designer/data/ui-reasoning.csv +162 -0
- package/.agent/skills/designer/data/ux-guidelines.csv +100 -0
- package/.agent/skills/designer/references/accessibility.md +172 -0
- package/.agent/skills/designer/references/branding.md +88 -0
- package/.agent/skills/designer/references/color-theory.md +139 -0
- package/.agent/skills/designer/references/creation.md +118 -0
- package/.agent/skills/designer/references/design-systems.md +219 -0
- package/.agent/skills/designer/references/frontend_design_aesthetics.md +57 -0
- package/.agent/skills/designer/references/layout.md +200 -0
- package/.agent/skills/designer/references/motion.md +92 -0
- package/.agent/skills/designer/references/review.md +100 -0
- package/.agent/skills/designer/references/trends.md +209 -0
- package/.agent/skills/designer/references/typography.md +190 -0
- package/.agent/skills/designer/scripts/remove_background.py +135 -0
- package/.agent/skills/designer/scripts/ui-search/__pycache__/core.cpython-314.pyc +0 -0
- package/.agent/skills/designer/scripts/ui-search/__pycache__/design_system.cpython-314.pyc +0 -0
- package/.agent/skills/designer/scripts/ui-search/core.py +217 -0
- package/.agent/skills/designer/scripts/ui-search/design_system.py +1067 -0
- package/.agent/skills/designer/scripts/ui-search/search.py +114 -0
- package/.agent/skills/designer/templates/design-motion-spec.md +30 -0
- package/.agent/skills/devops-engineer/SKILL.md +90 -0
- package/.agent/skills/devops-engineer/docker-compose/README.md +47 -0
- package/.agent/skills/devops-engineer/references/ci-cd-pipelines.md +76 -0
- package/.agent/skills/devops-engineer/references/cloud-providers.md +57 -0
- package/.agent/skills/devops-engineer/references/codebase-normalization.md +104 -0
- package/.agent/skills/devops-engineer/references/container-orchestration.md +69 -0
- package/.agent/skills/devops-engineer/references/iac-tools.md +63 -0
- package/.agent/skills/devops-engineer/references/observability-security.md +45 -0
- package/.agent/skills/devops-engineer/references/vercel-supabase.md +17 -0
- package/.agent/skills/devops-engineer/templates/release-notes.md +8 -0
- package/.agent/skills/frontend-developer/SKILL.md +125 -0
- package/.agent/skills/frontend-developer/react-nextjs/README.md +90 -0
- package/.agent/skills/frontend-developer/references/angular.md +52 -0
- package/.agent/skills/frontend-developer/references/composition_patterns.md +60 -0
- package/.agent/skills/frontend-developer/references/core-performance.md +68 -0
- package/.agent/skills/frontend-developer/references/modern-signals.md +43 -0
- package/.agent/skills/frontend-developer/references/react_performance_rules.md +55 -0
- package/.agent/skills/frontend-developer/references/vue-nuxt.md +55 -0
- package/.agent/skills/frontend-developer/scripts/validate_compliance.py +65 -0
- package/.agent/skills/frontend-developer/threejs/README.md +89 -0
- package/.agent/skills/frontend-developer/threejs/animation.md +552 -0
- package/.agent/skills/frontend-developer/threejs/fundamentals.md +488 -0
- package/.agent/skills/frontend-developer/threejs/geometry.md +548 -0
- package/.agent/skills/frontend-developer/threejs/interaction.md +660 -0
- package/.agent/skills/frontend-developer/threejs/lighting.md +481 -0
- package/.agent/skills/frontend-developer/threejs/loaders.md +623 -0
- package/.agent/skills/frontend-developer/threejs/materials.md +520 -0
- package/.agent/skills/frontend-developer/threejs/postprocessing.md +602 -0
- package/.agent/skills/frontend-developer/threejs/router.json +181 -0
- package/.agent/skills/frontend-developer/threejs/shaders.md +642 -0
- package/.agent/skills/frontend-developer/threejs/textures.md +628 -0
- package/.agent/skills/game-development/2d-games/SKILL.md +119 -0
- package/.agent/skills/game-development/3d-games/SKILL.md +135 -0
- package/.agent/skills/game-development/SKILL.md +167 -0
- package/.agent/skills/game-development/game-art/SKILL.md +185 -0
- package/.agent/skills/game-development/game-audio/SKILL.md +190 -0
- package/.agent/skills/game-development/game-design/SKILL.md +129 -0
- package/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
- package/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
- package/.agent/skills/game-development/pc-games/SKILL.md +144 -0
- package/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
- package/.agent/skills/game-development/web-games/SKILL.md +150 -0
- package/.agent/skills/lead-architect/SKILL.md +85 -0
- package/.agent/skills/lead-architect/references/application-architecture.md +70 -0
- package/.agent/skills/lead-architect/references/infrastructure.md +51 -0
- package/.agent/skills/lead-architect/references/process.md +42 -0
- package/.agent/skills/lead-architect/references/system-architecture.md +62 -0
- package/.agent/skills/lead-architect/references/web-fullstack.md +82 -0
- package/.agent/skills/lead-architect/templates/adr.md +62 -0
- package/.agent/skills/lead-architect/templates/rfc.md +46 -0
- package/.agent/skills/lead-architect/templates/sdd.md +62 -0
- package/.agent/skills/lead-architect/templates/technical-spec.md +61 -0
- package/.agent/skills/marketer/SKILL.md +66 -0
- package/.agent/skills/marketer/remotion-best-practices/SKILL.md +58 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/3d.md +86 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/animations.md +29 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +108 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/assets.md +78 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/audio.md +172 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/calculate-metadata.md +104 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/can-decode.md +75 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/charts.md +58 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/compositions.md +146 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/display-captions.md +126 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/extract-frames.md +229 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/fonts.md +152 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/get-video-duration.md +58 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/gifs.md +138 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/images.md +130 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/import-srt-captions.md +67 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/lottie.md +68 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/measuring-dom-nodes.md +35 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/measuring-text.md +143 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/sequencing.md +106 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/tailwind.md +11 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/text-animations.md +20 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/timing.md +179 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/transcribe-captions.md +19 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/transitions.md +122 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/trimming.md +53 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/videos.md +171 -0
- package/.agent/skills/mcp-builder/SKILL.md +76 -0
- package/.agent/skills/mcp-builder/references/evaluation.md +602 -0
- package/.agent/skills/mcp-builder/references/mcp_best_practices.md +249 -0
- package/.agent/skills/mcp-builder/references/node_mcp_server.md +970 -0
- package/.agent/skills/mcp-builder/references/python_mcp_server.md +719 -0
- package/.agent/skills/mobile-developer/SKILL.md +83 -0
- package/.agent/skills/mobile-developer/api-routes/SKILL.md +389 -0
- package/.agent/skills/mobile-developer/building-ui/SKILL.md +335 -0
- package/.agent/skills/mobile-developer/building-ui/references/animations.md +220 -0
- package/.agent/skills/mobile-developer/building-ui/references/controls.md +270 -0
- package/.agent/skills/mobile-developer/building-ui/references/form-sheet.md +227 -0
- package/.agent/skills/mobile-developer/building-ui/references/gradients.md +106 -0
- package/.agent/skills/mobile-developer/building-ui/references/icons.md +213 -0
- package/.agent/skills/mobile-developer/building-ui/references/media.md +198 -0
- package/.agent/skills/mobile-developer/building-ui/references/route-structure.md +229 -0
- package/.agent/skills/mobile-developer/building-ui/references/search.md +248 -0
- package/.agent/skills/mobile-developer/building-ui/references/storage.md +121 -0
- package/.agent/skills/mobile-developer/building-ui/references/tabs.md +368 -0
- package/.agent/skills/mobile-developer/building-ui/references/visual-effects.md +197 -0
- package/.agent/skills/mobile-developer/building-ui/references/webgpu-three.md +605 -0
- package/.agent/skills/mobile-developer/cicd-workflows/SKILL.md +107 -0
- package/.agent/skills/mobile-developer/cicd-workflows/scripts/fetch.js +109 -0
- package/.agent/skills/mobile-developer/cicd-workflows/scripts/package.json +11 -0
- package/.agent/skills/mobile-developer/cicd-workflows/scripts/validate.js +84 -0
- package/.agent/skills/mobile-developer/data-fetching/SKILL.md +508 -0
- package/.agent/skills/mobile-developer/deployment/SKILL.md +207 -0
- package/.agent/skills/mobile-developer/deployment/references/app-store-metadata.md +479 -0
- package/.agent/skills/mobile-developer/deployment/references/ios-app-store.md +355 -0
- package/.agent/skills/mobile-developer/deployment/references/play-store.md +246 -0
- package/.agent/skills/mobile-developer/deployment/references/testflight.md +58 -0
- package/.agent/skills/mobile-developer/deployment/references/workflows.md +200 -0
- package/.agent/skills/mobile-developer/dev-client/SKILL.md +181 -0
- package/.agent/skills/mobile-developer/tailwind-setup/SKILL.md +501 -0
- package/.agent/skills/mobile-developer/upgrading-expo/SKILL.md +116 -0
- package/.agent/skills/mobile-developer/upgrading-expo/references/new-architecture.md +79 -0
- package/.agent/skills/mobile-developer/upgrading-expo/references/react-19.md +79 -0
- package/.agent/skills/mobile-developer/upgrading-expo/references/react-compiler.md +59 -0
- package/.agent/skills/mobile-developer/use-dom/SKILL.md +434 -0
- package/.agent/skills/modern-python/SKILL.md +122 -0
- package/.agent/skills/project-manager/SKILL.md +110 -0
- package/.agent/skills/project-manager/references/ba-collaboration.md +62 -0
- package/.agent/skills/project-manager/references/discovery_process.md +52 -0
- package/.agent/skills/project-manager/references/jobs_to_be_done.md +51 -0
- package/.agent/skills/project-manager/references/prd_development.md +52 -0
- package/.agent/skills/project-manager/references/rules-guide.md +55 -0
- package/.agent/skills/project-manager/references/skill-creation.md +98 -0
- package/.agent/skills/project-manager/references/strategic-frameworks.md +62 -0
- package/.agent/skills/project-manager/references/task-decomposition.md +194 -0
- package/.agent/skills/project-manager/references/workflows-guide.md +44 -0
- package/.agent/skills/project-manager/router.json +160 -0
- package/.agent/skills/project-manager/scripts/compare_skill.py +177 -0
- package/.agent/skills/project-manager/scripts/encoding_utils.py +36 -0
- package/.agent/skills/project-manager/scripts/init_skill.py +190 -0
- package/.agent/skills/project-manager/scripts/quick_validate.py +123 -0
- package/.agent/skills/project-manager/templates/pm-strategy-one-pager.md +6 -0
- package/.agent/skills/project-manager/templates/prd-strategic.md +38 -0
- package/.agent/skills/project-manager/templates/skill-questionnaire.md +118 -0
- package/.agent/skills/project-manager/templates/user-story-simple.md +14 -0
- package/.agent/skills/prompt-engineer/SKILL.md +319 -0
- package/.agent/skills/prompt-engineer/skill-creator/README.md +47 -0
- package/.agent/skills/qa-tester/SKILL.md +142 -0
- package/.agent/skills/qa-tester/assets/README.md +8 -0
- package/.agent/skills/qa-tester/references/accessibility_testing.md +35 -0
- package/.agent/skills/qa-tester/references/agent_browser.md +38 -0
- package/.agent/skills/qa-tester/references/automation/api_testing.md +23 -0
- package/.agent/skills/qa-tester/references/automation/best_practices.md +14 -0
- package/.agent/skills/qa-tester/references/automation/jest_vitest.md +26 -0
- package/.agent/skills/qa-tester/references/automation/playwright.md +30 -0
- package/.agent/skills/qa-tester/references/e2e_testing.md +46 -0
- package/.agent/skills/qa-tester/references/integration_testing.md +39 -0
- package/.agent/skills/qa-tester/references/performance_testing.md +44 -0
- package/.agent/skills/qa-tester/references/property_based_testing.md +44 -0
- package/.agent/skills/qa-tester/references/security_audit.md +53 -0
- package/.agent/skills/qa-tester/references/security_testing.md +30 -0
- package/.agent/skills/qa-tester/references/sharp_edges.md +49 -0
- package/.agent/skills/qa-tester/references/static_analysis.md +52 -0
- package/.agent/skills/qa-tester/references/supply_chain_audit.md +54 -0
- package/.agent/skills/qa-tester/references/test_case_standards.md +96 -0
- package/.agent/skills/qa-tester/references/test_report_template.md +32 -0
- package/.agent/skills/qa-tester/references/unit_testing.md +50 -0
- package/.agent/skills/qa-tester/references/visual_testing.md +32 -0
- package/.agent/skills/qa-tester/templates/uat-plan.md +34 -0
- package/.agent/skills/research-first/SKILL.md +118 -0
- package/.agent/skills-manifest.json +264 -0
- package/.agent/workflows/absorb.md +176 -0
- package/.agent/workflows/bootstrap.md +91 -0
- package/.agent/workflows/brainstorm.md +168 -0
- package/.agent/workflows/break-tasks.md +77 -0
- package/.agent/workflows/commit.md +349 -0
- package/.agent/workflows/custom-behavior.md +64 -0
- package/.agent/workflows/debug.md +65 -0
- package/.agent/workflows/development.md +49 -0
- package/.agent/workflows/documentation.md +221 -0
- package/.agent/workflows/gen-tests.md +53 -0
- package/.agent/workflows/guide.md +196 -0
- package/.agent/workflows/implement-feature.md +182 -0
- package/.agent/workflows/install-skill.md +193 -0
- package/.agent/workflows/qa.md +54 -0
- package/.agent/workflows/ui-ux-design.md +108 -0
- package/LICENSE +21 -0
- package/README.md +258 -0
- package/cli/index.js +345 -0
- package/cli/migrate-skills.js +113 -0
- package/cli/verify.js +291 -0
- package/package.json +49 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: building-ui
|
|
3
|
+
description: >
|
|
4
|
+
Complete guide for building beautiful apps with Expo Router. Covers fundamentals, styling, components, navigation, animations, patterns, and native tabs.
|
|
5
|
+
license: MIT
|
|
6
|
+
compatibility: Claude Code, Cursor, Gemini CLI, GitHub Copilot
|
|
7
|
+
metadata:
|
|
8
|
+
author: jhm1909
|
|
9
|
+
version: "2.0.0"
|
|
10
|
+
domain: mobile
|
|
11
|
+
estimated_tokens: 8000
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Expo UI Guidelines
|
|
15
|
+
|
|
16
|
+
Building beautiful mobile apps with Expo Router and React Native.
|
|
17
|
+
|
|
18
|
+
## Knowledge Graph
|
|
19
|
+
|
|
20
|
+
- **extends**: [[mobile-developer]]
|
|
21
|
+
- **requires**: []
|
|
22
|
+
- **suggests**: [[tailwind-setup]], [[use-dom]]
|
|
23
|
+
- **conflicts**: []
|
|
24
|
+
- **enhances**: []
|
|
25
|
+
- **moc**: [[mobile-development-moc]]
|
|
26
|
+
|
|
27
|
+
## References
|
|
28
|
+
|
|
29
|
+
# Expo UI Guidelines
|
|
30
|
+
|
|
31
|
+
## References
|
|
32
|
+
|
|
33
|
+
Consult these resources as needed:
|
|
34
|
+
|
|
35
|
+
- ./references/route-structure.md -- Route file conventions, dynamic routes, query parameters, groups, and folder organization
|
|
36
|
+
- ./references/tabs.md -- Native tab bar with NativeTabs, migration from JS tabs, iOS 26 features
|
|
37
|
+
- ./references/icons.md -- SF Symbols with expo-symbols, common icon names, animations, and weights
|
|
38
|
+
- ./references/controls.md -- Native iOS controls: Switch, Slider, SegmentedControl, DateTimePicker, Picker
|
|
39
|
+
- ./references/visual-effects.md -- Blur effects with expo-blur and liquid glass with expo-glass-effect
|
|
40
|
+
- ./references/animations.md -- Reanimated animations: entering, exiting, layout, scroll-driven, and gestures
|
|
41
|
+
- ./references/search.md -- Search bar integration with headers, useSearch hook, and filtering patterns
|
|
42
|
+
- ./references/gradients.md -- CSS gradients using experimental_backgroundImage (New Architecture only)
|
|
43
|
+
- ./references/media.md -- Media handling for Expo Router including camera, audio, video, and file saving
|
|
44
|
+
- ./references/storage.md -- Data storage patterns including SQLite, AsyncStorage, and SecureStore
|
|
45
|
+
- ./references/webgpu-three.md -- 3D graphics, games, and GPU-powered visualizations with WebGPU and Three.js
|
|
46
|
+
|
|
47
|
+
## Running the App
|
|
48
|
+
|
|
49
|
+
**CRITICAL: Always try Expo Go first before creating custom builds.**
|
|
50
|
+
|
|
51
|
+
Most Expo apps work in Expo Go without any custom native code. Before running `npx expo run:ios` or `npx expo run:android`:
|
|
52
|
+
|
|
53
|
+
1. **Start with Expo Go**: Run `npx expo start` and scan the QR code with Expo Go
|
|
54
|
+
2. **Check if features work**: Test your app thoroughly in Expo Go
|
|
55
|
+
3. **Only create custom builds when required** - see below
|
|
56
|
+
|
|
57
|
+
### When Custom Builds Are Required
|
|
58
|
+
|
|
59
|
+
You need `npx expo run:ios/android` or `eas build` ONLY when using:
|
|
60
|
+
|
|
61
|
+
- **Local Expo modules** (custom native code in `modules/`)
|
|
62
|
+
- **Apple targets** (widgets, app clips, extensions via `@bacons/apple-targets`)
|
|
63
|
+
- **Third-party native modules** not included in Expo Go
|
|
64
|
+
- **Custom native configuration** that can't be expressed in `app.json`
|
|
65
|
+
|
|
66
|
+
### When Expo Go Works
|
|
67
|
+
|
|
68
|
+
Expo Go supports a huge range of features out of the box:
|
|
69
|
+
|
|
70
|
+
- All `expo-*` packages (camera, location, notifications, etc.)
|
|
71
|
+
- Expo Router navigation
|
|
72
|
+
- Most UI libraries (reanimated, gesture handler, etc.)
|
|
73
|
+
- Push notifications, deep links, and more
|
|
74
|
+
|
|
75
|
+
**If you're unsure, try Expo Go first.** Creating custom builds adds complexity, slower iteration, and requires Xcode/Android Studio setup.
|
|
76
|
+
|
|
77
|
+
## Code Style
|
|
78
|
+
|
|
79
|
+
- Be cautious of unterminated strings. Ensure nested backticks are escaped; never forget to escape quotes correctly.
|
|
80
|
+
- Always use import statements at the top of the file.
|
|
81
|
+
- Always use kebab-case for file names, e.g. `comment-card.tsx`
|
|
82
|
+
- Always remove old route files when moving or restructuring navigation
|
|
83
|
+
- Never use special characters in file names
|
|
84
|
+
- Configure tsconfig.json with path aliases, and prefer aliases over relative imports for refactors.
|
|
85
|
+
|
|
86
|
+
## Routes
|
|
87
|
+
|
|
88
|
+
See `./references/route-structure.md` for detailed route conventions.
|
|
89
|
+
|
|
90
|
+
- Routes belong in the `app` directory.
|
|
91
|
+
- Never co-locate components, types, or utilities in the app directory. This is an anti-pattern.
|
|
92
|
+
- Ensure the app always has a route that matches "/", it may be inside a group route.
|
|
93
|
+
|
|
94
|
+
## Library Preferences
|
|
95
|
+
|
|
96
|
+
- Never use modules removed from React Native such as Picker, WebView, SafeAreaView, or AsyncStorage
|
|
97
|
+
- Never use legacy expo-permissions
|
|
98
|
+
- `expo-audio` not `expo-av`
|
|
99
|
+
- `expo-video` not `expo-av`
|
|
100
|
+
- `expo-symbols` not `@expo/vector-icons`
|
|
101
|
+
- `react-native-safe-area-context` not react-native SafeAreaView
|
|
102
|
+
- `process.env.EXPO_OS` not `Platform.OS`
|
|
103
|
+
- `React.use` not `React.useContext`
|
|
104
|
+
- `expo-image` Image component instead of intrinsic element `img`
|
|
105
|
+
- `expo-glass-effect` for liquid glass backdrops
|
|
106
|
+
|
|
107
|
+
## Responsiveness
|
|
108
|
+
|
|
109
|
+
- Always wrap root component in a scroll view for responsiveness
|
|
110
|
+
- Use `<ScrollView contentInsetAdjustmentBehavior="automatic" />` instead of `<SafeAreaView>` for smarter safe area insets
|
|
111
|
+
- `contentInsetAdjustmentBehavior="automatic"` should be applied to FlatList and SectionList as well
|
|
112
|
+
- Use flexbox instead of Dimensions API
|
|
113
|
+
- ALWAYS prefer `useWindowDimensions` over `Dimensions.get()` to measure screen size
|
|
114
|
+
|
|
115
|
+
## Behavior
|
|
116
|
+
|
|
117
|
+
- Use expo-haptics conditionally on iOS to make more delightful experiences
|
|
118
|
+
- Use views with built-in haptics like `<Switch />` from React Native and `@react-native-community/datetimepicker`
|
|
119
|
+
- When a route belongs to a Stack, its first child should almost always be a ScrollView with `contentInsetAdjustmentBehavior="automatic"` set
|
|
120
|
+
- Prefer `headerSearchBarOptions` in Stack.Screen options to add a search bar
|
|
121
|
+
- Use the `<Text selectable />` prop on text containing data that could be copied
|
|
122
|
+
- Consider formatting large numbers like 1.4M or 38k
|
|
123
|
+
- Never use intrinsic elements like 'img' or 'div' unless in a webview or Expo DOM component
|
|
124
|
+
|
|
125
|
+
# Styling
|
|
126
|
+
|
|
127
|
+
Follow Apple Human Interface Guidelines.
|
|
128
|
+
|
|
129
|
+
## General Styling Rules
|
|
130
|
+
|
|
131
|
+
- Prefer flex gap over margin and padding styles
|
|
132
|
+
- Prefer padding over margin where possible
|
|
133
|
+
- Always account for safe area, either with stack headers, tabs, or ScrollView/FlatList `contentInsetAdjustmentBehavior="automatic"`
|
|
134
|
+
- Ensure both top and bottom safe area insets are accounted for
|
|
135
|
+
- Inline styles not StyleSheet.create unless reusing styles is faster
|
|
136
|
+
- Add entering and exiting animations for state changes
|
|
137
|
+
- Use `{ borderCurve: 'continuous' }` for rounded corners unless creating a capsule shape
|
|
138
|
+
- ALWAYS use a navigation stack title instead of a custom text element on the page
|
|
139
|
+
- When padding a ScrollView, use `contentContainerStyle` padding and gap instead of padding on the ScrollView itself (reduces clipping)
|
|
140
|
+
- CSS and Tailwind are not supported - use inline styles
|
|
141
|
+
|
|
142
|
+
## Text Styling
|
|
143
|
+
|
|
144
|
+
- Add the `selectable` prop to every `<Text/>` element displaying important data or error messages
|
|
145
|
+
- Counters should use `{ fontVariant: 'tabular-nums' }` for alignment
|
|
146
|
+
|
|
147
|
+
## Shadows
|
|
148
|
+
|
|
149
|
+
Use CSS `boxShadow` style prop. NEVER use legacy React Native shadow or elevation styles.
|
|
150
|
+
|
|
151
|
+
```tsx
|
|
152
|
+
<View style={{ boxShadow: "0 1px 2px rgba(0, 0, 0, 0.05)" }} />
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
'inset' shadows are supported.
|
|
156
|
+
|
|
157
|
+
# Navigation
|
|
158
|
+
|
|
159
|
+
## Link
|
|
160
|
+
|
|
161
|
+
Use `<Link href="/path" />` from 'expo-router' for navigation between routes.
|
|
162
|
+
|
|
163
|
+
```tsx
|
|
164
|
+
import { Link } from 'expo-router';
|
|
165
|
+
|
|
166
|
+
// Basic link
|
|
167
|
+
<Link href="/path" />
|
|
168
|
+
|
|
169
|
+
// Wrapping custom components
|
|
170
|
+
<Link href="/path" asChild>
|
|
171
|
+
<Pressable>...</Pressable>
|
|
172
|
+
</Link>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Whenever possible, include a `<Link.Preview>` to follow iOS conventions. Add context menus and previews frequently to enhance navigation.
|
|
176
|
+
|
|
177
|
+
## Stack
|
|
178
|
+
|
|
179
|
+
- ALWAYS use `_layout.tsx` files to define stacks
|
|
180
|
+
- Use Stack from 'expo-router/stack' for native navigation stacks
|
|
181
|
+
|
|
182
|
+
### Page Title
|
|
183
|
+
|
|
184
|
+
Set the page title in Stack.Screen options:
|
|
185
|
+
|
|
186
|
+
```tsx
|
|
187
|
+
<Stack.Screen options={{ title: "Home" }} />
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Context Menus
|
|
191
|
+
|
|
192
|
+
Add long press context menus to Link components:
|
|
193
|
+
|
|
194
|
+
```tsx
|
|
195
|
+
import { Link } from "expo-router";
|
|
196
|
+
|
|
197
|
+
<Link href="/settings" asChild>
|
|
198
|
+
<Link.Trigger>
|
|
199
|
+
<Pressable>
|
|
200
|
+
<Card />
|
|
201
|
+
</Pressable>
|
|
202
|
+
</Link.Trigger>
|
|
203
|
+
<Link.Menu>
|
|
204
|
+
<Link.MenuAction
|
|
205
|
+
title="Share"
|
|
206
|
+
icon="square.and.arrow.up"
|
|
207
|
+
onPress={handleSharePress}
|
|
208
|
+
/>
|
|
209
|
+
<Link.MenuAction
|
|
210
|
+
title="Block"
|
|
211
|
+
icon="nosign"
|
|
212
|
+
destructive
|
|
213
|
+
onPress={handleBlockPress}
|
|
214
|
+
/>
|
|
215
|
+
<Link.Menu title="More" icon="ellipsis">
|
|
216
|
+
<Link.MenuAction title="Copy" icon="doc.on.doc" onPress={() => {}} />
|
|
217
|
+
<Link.MenuAction
|
|
218
|
+
title="Delete"
|
|
219
|
+
icon="trash"
|
|
220
|
+
destructive
|
|
221
|
+
onPress={() => {}}
|
|
222
|
+
/>
|
|
223
|
+
</Link.Menu>
|
|
224
|
+
</Link.Menu>
|
|
225
|
+
</Link>;
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Link Previews
|
|
229
|
+
|
|
230
|
+
Use link previews frequently to enhance navigation:
|
|
231
|
+
|
|
232
|
+
```tsx
|
|
233
|
+
<Link href="/settings">
|
|
234
|
+
<Link.Trigger>
|
|
235
|
+
<Pressable>
|
|
236
|
+
<Card />
|
|
237
|
+
</Pressable>
|
|
238
|
+
</Link.Trigger>
|
|
239
|
+
<Link.Preview />
|
|
240
|
+
</Link>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Link preview can be used with context menus.
|
|
244
|
+
|
|
245
|
+
## Modal
|
|
246
|
+
|
|
247
|
+
Present a screen as a modal:
|
|
248
|
+
|
|
249
|
+
```tsx
|
|
250
|
+
<Stack.Screen name="modal" options={{ presentation: "modal" }} />
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Prefer this to building a custom modal component.
|
|
254
|
+
|
|
255
|
+
## Sheet
|
|
256
|
+
|
|
257
|
+
Present a screen as a dynamic form sheet:
|
|
258
|
+
|
|
259
|
+
```tsx
|
|
260
|
+
<Stack.Screen
|
|
261
|
+
name="sheet"
|
|
262
|
+
options={{
|
|
263
|
+
presentation: "formSheet",
|
|
264
|
+
sheetGrabberVisible: true,
|
|
265
|
+
sheetAllowedDetents: [0.5, 1.0],
|
|
266
|
+
contentStyle: { backgroundColor: "transparent" },
|
|
267
|
+
}}
|
|
268
|
+
/>
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
- Using `contentStyle: { backgroundColor: "transparent" }` makes the background liquid glass on iOS 26+.
|
|
272
|
+
|
|
273
|
+
## Common route structure
|
|
274
|
+
|
|
275
|
+
A standard app layout with tabs and stacks inside each tab:
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
app/
|
|
279
|
+
_layout.tsx — <NativeTabs />
|
|
280
|
+
(index,search)/
|
|
281
|
+
_layout.tsx — <Stack />
|
|
282
|
+
index.tsx — Main list
|
|
283
|
+
search.tsx — Search view
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
```tsx
|
|
287
|
+
// app/_layout.tsx
|
|
288
|
+
import { NativeTabs, Icon, Label } from "expo-router/unstable-native-tabs";
|
|
289
|
+
import { Theme } from "../components/theme";
|
|
290
|
+
|
|
291
|
+
export default function Layout() {
|
|
292
|
+
return (
|
|
293
|
+
<Theme>
|
|
294
|
+
<NativeTabs>
|
|
295
|
+
<NativeTabs.Trigger name="(index)">
|
|
296
|
+
<Icon sf="list.dash" />
|
|
297
|
+
<Label>Items</Label>
|
|
298
|
+
</NativeTabs.Trigger>
|
|
299
|
+
<NativeTabs.Trigger name="(search)" role="search" />
|
|
300
|
+
</NativeTabs>
|
|
301
|
+
</Theme>
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
Create a shared group route so both tabs can push common screens:
|
|
307
|
+
|
|
308
|
+
```tsx
|
|
309
|
+
// app/(index,search)/_layout.tsx
|
|
310
|
+
import { Stack } from "expo-router/stack";
|
|
311
|
+
import { PlatformColor } from "react-native";
|
|
312
|
+
|
|
313
|
+
export default function Layout({ segment }) {
|
|
314
|
+
const screen = segment.match(/\((.*)\)/)?.[1]!;
|
|
315
|
+
const titles: Record<string, string> = { index: "Items", search: "Search" };
|
|
316
|
+
|
|
317
|
+
return (
|
|
318
|
+
<Stack
|
|
319
|
+
screenOptions={{
|
|
320
|
+
headerTransparent: true,
|
|
321
|
+
headerShadowVisible: false,
|
|
322
|
+
headerLargeTitleShadowVisible: false,
|
|
323
|
+
headerLargeStyle: { backgroundColor: "transparent" },
|
|
324
|
+
headerTitleStyle: { color: PlatformColor("label") },
|
|
325
|
+
headerLargeTitle: true,
|
|
326
|
+
headerBlurEffect: "none",
|
|
327
|
+
headerBackButtonDisplayMode: "minimal",
|
|
328
|
+
}}
|
|
329
|
+
>
|
|
330
|
+
<Stack.Screen name={screen} options={{ title: titles[screen] }} />
|
|
331
|
+
<Stack.Screen name="i/[id]" options={{ headerLargeTitle: false }} />
|
|
332
|
+
</Stack>
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
```
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# Animations
|
|
2
|
+
|
|
3
|
+
Use Reanimated v4. Avoid React Native's built-in Animated API.
|
|
4
|
+
|
|
5
|
+
## Entering and Exiting Animations
|
|
6
|
+
|
|
7
|
+
Use Animated.View with entering and exiting animations. Layout animations can animate state changes.
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import Animated, {
|
|
11
|
+
FadeIn,
|
|
12
|
+
FadeOut,
|
|
13
|
+
LinearTransition,
|
|
14
|
+
} from "react-native-reanimated";
|
|
15
|
+
|
|
16
|
+
function App() {
|
|
17
|
+
return (
|
|
18
|
+
<Animated.View
|
|
19
|
+
entering={FadeIn}
|
|
20
|
+
exiting={FadeOut}
|
|
21
|
+
layout={LinearTransition}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## On-Scroll Animations
|
|
28
|
+
|
|
29
|
+
Create high-performance scroll animations using Reanimated's hooks:
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import Animated, {
|
|
33
|
+
useAnimatedRef,
|
|
34
|
+
useScrollViewOffset,
|
|
35
|
+
useAnimatedStyle,
|
|
36
|
+
interpolate,
|
|
37
|
+
} from "react-native-reanimated";
|
|
38
|
+
|
|
39
|
+
function Page() {
|
|
40
|
+
const ref = useAnimatedRef();
|
|
41
|
+
const scroll = useScrollViewOffset(ref);
|
|
42
|
+
|
|
43
|
+
const style = useAnimatedStyle(() => ({
|
|
44
|
+
opacity: interpolate(scroll.value, [0, 30], [0, 1], "clamp"),
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Animated.ScrollView ref={ref}>
|
|
49
|
+
<Animated.View style={style} />
|
|
50
|
+
</Animated.ScrollView>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Common Animation Presets
|
|
56
|
+
|
|
57
|
+
### Entering Animations
|
|
58
|
+
|
|
59
|
+
- `FadeIn`, `FadeInUp`, `FadeInDown`, `FadeInLeft`, `FadeInRight`
|
|
60
|
+
- `SlideInUp`, `SlideInDown`, `SlideInLeft`, `SlideInRight`
|
|
61
|
+
- `ZoomIn`, `ZoomInUp`, `ZoomInDown`
|
|
62
|
+
- `BounceIn`, `BounceInUp`, `BounceInDown`
|
|
63
|
+
|
|
64
|
+
### Exiting Animations
|
|
65
|
+
|
|
66
|
+
- `FadeOut`, `FadeOutUp`, `FadeOutDown`, `FadeOutLeft`, `FadeOutRight`
|
|
67
|
+
- `SlideOutUp`, `SlideOutDown`, `SlideOutLeft`, `SlideOutRight`
|
|
68
|
+
- `ZoomOut`, `ZoomOutUp`, `ZoomOutDown`
|
|
69
|
+
- `BounceOut`, `BounceOutUp`, `BounceOutDown`
|
|
70
|
+
|
|
71
|
+
### Layout Animations
|
|
72
|
+
|
|
73
|
+
- `LinearTransition` — Smooth linear interpolation
|
|
74
|
+
- `SequencedTransition` — Sequenced property changes
|
|
75
|
+
- `FadingTransition` — Fade between states
|
|
76
|
+
|
|
77
|
+
## Customizing Animations
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
<Animated.View
|
|
81
|
+
entering={FadeInDown.duration(500).delay(200)}
|
|
82
|
+
exiting={FadeOut.duration(300)}
|
|
83
|
+
/>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Modifiers
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
// Duration in milliseconds
|
|
90
|
+
FadeIn.duration(300);
|
|
91
|
+
|
|
92
|
+
// Delay before starting
|
|
93
|
+
FadeIn.delay(100);
|
|
94
|
+
|
|
95
|
+
// Spring physics
|
|
96
|
+
FadeIn.springify();
|
|
97
|
+
FadeIn.springify().damping(15).stiffness(100);
|
|
98
|
+
|
|
99
|
+
// Easing curves
|
|
100
|
+
FadeIn.easing(Easing.bezier(0.25, 0.1, 0.25, 1));
|
|
101
|
+
|
|
102
|
+
// Chaining
|
|
103
|
+
FadeInDown.duration(400).delay(200).springify();
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Shared Value Animations
|
|
107
|
+
|
|
108
|
+
For imperative control over animations:
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
import {
|
|
112
|
+
useSharedValue,
|
|
113
|
+
withSpring,
|
|
114
|
+
withTiming,
|
|
115
|
+
} from "react-native-reanimated";
|
|
116
|
+
|
|
117
|
+
const offset = useSharedValue(0);
|
|
118
|
+
|
|
119
|
+
// Spring animation
|
|
120
|
+
offset.value = withSpring(100);
|
|
121
|
+
|
|
122
|
+
// Timing animation
|
|
123
|
+
offset.value = withTiming(100, { duration: 300 });
|
|
124
|
+
|
|
125
|
+
// Use in styles
|
|
126
|
+
const style = useAnimatedStyle(() => ({
|
|
127
|
+
transform: [{ translateX: offset.value }],
|
|
128
|
+
}));
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Gesture Animations
|
|
132
|
+
|
|
133
|
+
Combine with React Native Gesture Handler:
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
137
|
+
import Animated, {
|
|
138
|
+
useSharedValue,
|
|
139
|
+
useAnimatedStyle,
|
|
140
|
+
withSpring,
|
|
141
|
+
} from "react-native-reanimated";
|
|
142
|
+
|
|
143
|
+
function DraggableBox() {
|
|
144
|
+
const translateX = useSharedValue(0);
|
|
145
|
+
const translateY = useSharedValue(0);
|
|
146
|
+
|
|
147
|
+
const gesture = Gesture.Pan()
|
|
148
|
+
.onUpdate((e) => {
|
|
149
|
+
translateX.value = e.translationX;
|
|
150
|
+
translateY.value = e.translationY;
|
|
151
|
+
})
|
|
152
|
+
.onEnd(() => {
|
|
153
|
+
translateX.value = withSpring(0);
|
|
154
|
+
translateY.value = withSpring(0);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
const style = useAnimatedStyle(() => ({
|
|
158
|
+
transform: [
|
|
159
|
+
{ translateX: translateX.value },
|
|
160
|
+
{ translateY: translateY.value },
|
|
161
|
+
],
|
|
162
|
+
}));
|
|
163
|
+
|
|
164
|
+
return (
|
|
165
|
+
<GestureDetector gesture={gesture}>
|
|
166
|
+
<Animated.View style={[styles.box, style]} />
|
|
167
|
+
</GestureDetector>
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Keyboard Animations
|
|
173
|
+
|
|
174
|
+
Animate with keyboard height changes:
|
|
175
|
+
|
|
176
|
+
```tsx
|
|
177
|
+
import Animated, {
|
|
178
|
+
useAnimatedKeyboard,
|
|
179
|
+
useAnimatedStyle,
|
|
180
|
+
} from "react-native-reanimated";
|
|
181
|
+
|
|
182
|
+
function KeyboardAwareView() {
|
|
183
|
+
const keyboard = useAnimatedKeyboard();
|
|
184
|
+
|
|
185
|
+
const style = useAnimatedStyle(() => ({
|
|
186
|
+
paddingBottom: keyboard.height.value,
|
|
187
|
+
}));
|
|
188
|
+
|
|
189
|
+
return <Animated.View style={style}>{/* content */}</Animated.View>;
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Staggered List Animations
|
|
194
|
+
|
|
195
|
+
Animate list items with delays:
|
|
196
|
+
|
|
197
|
+
```tsx
|
|
198
|
+
{
|
|
199
|
+
items.map((item, index) => (
|
|
200
|
+
<Animated.View
|
|
201
|
+
key={item.id}
|
|
202
|
+
entering={FadeInUp.delay(index * 50)}
|
|
203
|
+
exiting={FadeOutUp}
|
|
204
|
+
>
|
|
205
|
+
<ListItem item={item} />
|
|
206
|
+
</Animated.View>
|
|
207
|
+
));
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Best Practices
|
|
212
|
+
|
|
213
|
+
- Add entering and exiting animations for state changes
|
|
214
|
+
- Use layout animations when items are added/removed from lists
|
|
215
|
+
- Use `useAnimatedStyle` for scroll-driven animations
|
|
216
|
+
- Prefer `interpolate` with "clamp" for bounded values
|
|
217
|
+
- You can't pass PlatformColors to reanimated views or styles; use static colors instead
|
|
218
|
+
- Keep animations under 300ms for responsive feel
|
|
219
|
+
- Use spring animations for natural movement
|
|
220
|
+
- Avoid animating layout properties (width, height) when possible — prefer transforms
|