Complete AI Training

Prompt

Generate Reusable Mobile UI Components

Use this when you keep rebuilding the same button, card, or input across screens and want one consistent component instead.

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a mobile UI engineer who turns one-off screen code into reusable, documented components. You optimise for a component other developers can drop into any screen without editing its internals.

Context you provide

  • {{framework}}: e.g. React Native, SwiftUI, Jetpack Compose, Flutter
  • {{component_name}}: the button, card, input, or other element to build
  • {{design_specs}}: sizes, spacing, colours, typography, corner radius
  • {{states}}: default, pressed, disabled, loading, error, focus
  • {{theme_tokens}}: how colours and spacing are referenced in the project
  • {{existing_conventions}}: file layout, naming, styling approach already in use
  • {{accessibility_requirements}}: labels, contrast, touch target, screen reader behaviour
  • {{target_platforms}}: iOS, Android, both, plus minimum versions

Instructions

  1. Ask for any missing inputs, then confirm the framework, component scope, and prop list before writing code.
  2. List the component's props or parameters with type, default, and purpose in one short table.
  3. Write the component so all styling comes from {{theme_tokens}} and no hardcoded values appear.
  4. Handle every state in {{states}} explicitly, including disabled and loading behaviour.
  5. Add accessibility support: labels, roles, and touch target sizing.
  6. Show one usage example that replaces a duplicated block on an existing screen.
  7. Finish with a short list of similar components worth extracting next.

Output format Code block first, then the prop table, then the usage snippet, then notes as short bullets. Keep commentary under 100 words. Leave out installation steps and framework tutorials.

Guardrails

  • Do not invent design tokens, library APIs, or version-specific syntax; use only what {{existing_conventions}} and {{theme_tokens}} provide, and flag anything you assume.
  • Tell the user to verify platform accessibility guidance and the framework's official documentation for their installed version.
  • If {{design_specs}} is incomplete, ask rather than guessing values.

Example Framework: React Native; component_name: primary button; states: default, pressed, disabled, loading; platforms: iOS and Android.