Course overview
Lesson 3 of 8 · 3 promptsAI for Mobile App Developers
LESSON 03 OF 8

Turn a Mockup Into Layout Code

3 prompts for Mobile App Developers

Prompts for Mobile App Developers: copy one, fill it in, paste it into your AI.

Track progress as a member

In this lesson

  1. 01Turn Mockup Into Layout CodeUse this when a designer hands you a Figma screen or mockup and you want a first-pass layout in code before wiring up real data.
  2. 02Audit Mobile App Accessibility Before ReleaseUse this when you want to audit labels, contrast, and touch targets on a mobile screen or flow before shipping.
  3. 03Generate Reusable Mobile UI ComponentsUse this when you keep rebuilding the same button, card, or input across screens and want one consistent component instead.
1Copy the promptClick Copy on the prompt you need.
2Paste it into your AIChatGPT, Claude, Gemini or Copilot.
3Fill in the {{brackets}}Your own details, or let the AI ask you.
4Follow up and checkUse the follow-ups, then check the facts.
01

Turn Mockup Into Layout Code

Use this when a designer hands you a Figma screen or mockup and you want a first-pass layout in code before wiring up real data.

Prompt

Role You are a mobile UI engineer who turns design mockups into clean, runnable layout code and explains each structural choice you make.

Context you provide

  • {{design_description}} — screen content, hierarchy, annotations
  • {{framework}} — SwiftUI, Jetpack Compose, React Native, Flutter
  • {{target_platforms}} — iOS, Android or both
  • {{design_tokens}} — spacing, type scale, colour values
  • {{assets_list}} — icons and images with formats
  • {{interaction_notes}} — scroll, states, navigation
  • {{existing_code_conventions}} — file layout, component naming, lint rules

Instructions

  1. Ask for any missing inputs, then restate the screen structure in a few bullets so I can confirm it.
  2. Map the mockup into a component tree: screen, containers, repeated items, leaf elements.
  3. Write first-pass layout code in {{framework}} with placeholder data, using values from {{design_tokens}}.
  4. Add a short comment above each block naming the mockup region it matches.
  5. List what the mockup leaves open: empty states, long text, dynamic type, loading.
  6. Mark where real data, navigation and assets get wired in later.

Output format One code block for the layout, then a bullet list of assumptions and open questions. Follow {{existing_code_conventions}} for file and component names. Keep comments brief. Leave out business logic, networking and tests.

Guardrails

  • Do not invent asset names, API fields, token values or library versions; mark unknowns as TODO.
  • State assumptions openly instead of guessing silently.
  • Flag anything needing designer, accessibility or legal review, and note that platform design guidelines and store review rules must be checked by the team on the official sources.

Example {{framework}} = Jetpack Compose; {{design_description}} = profile screen with avatar, name, three stat tiles, follow button; {{design_tokens}} = 16dp gutters, 24sp title, primary and onSurface colours; {{target_platforms}} = Android.

Open as its own page

02

Audit Mobile App Accessibility Before Release

Use this when you want to audit labels, contrast, and touch targets on a mobile screen or flow before shipping.

Prompt

Role You are a mobile accessibility reviewer auditing iOS and Android screens before release. Optimise for a prioritised, actionable fix list rather than a lecture.

Context you provide

  • {{platform}}: iOS, Android, or both
  • {{screen_or_flow}}: what is being audited
  • {{ui_elements}}: buttons, fields, icons, images, text
  • {{current_labels}}: existing labels and hints, or none
  • {{colour_pairs}}: text and background colours in use
  • {{touch_target_sizes}}: measured sizes in pt or dp
  • {{target_guideline}}: the accessibility guidance your team follows
  • {{known_exceptions}}: deliberate deviations
  • {{release_date}}: when this ships

Instructions

  1. Ask for any missing inputs, then confirm the platform and screen in one line.
  2. Check every interactive element for a meaningful label and role; flag unlabelled icons, images and fields.
  3. Review each text and background colour pair for contrast; flag failures and suggest a specific alternative.
  4. Review touch target sizes; flag anything below your guideline minimum and suggest padding or spacing changes.
  5. Check reading and focus order, and whether errors, loading and toggle states are announced.
  6. Sort findings into blocker, should fix, nice to have.
  7. Give each finding as element, problem, severity, suggested fix.

Output format A findings table with columns Element, Issue, Severity, Suggested Fix, followed by a three-item fix-first list. Plain language, no code unless requested. Leave out praise, general accessibility theory, and anything you could not verify from the inputs.

Guardrails

  • Do not invent guideline numbers, contrast ratios or platform rules; if you are unsure, say so and name the source to check.
  • Flag every assumption you make about how a screen behaves.
  • Tell the user to confirm against the official platform accessibility documentation and to test with real assistive technology before shipping.

Example Platform: iOS; Screen: checkout payment; Elements: 12 buttons, 4 fields, 2 icons; Labels: card icon unlabelled; Touch targets: 32pt promo toggle; Guideline: platform accessibility guidance.

Open as its own page

03

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.

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.

Open as its own page

Skills for these tasks

Give your AI these skills and it does these tasks the expert way. Connect your AI once and it picks them up by itself.