Mobile Constraints & iOS Optimization
Documents mobile-first responsive design and iOS-specific optimizations for a React UI kit, covering viewport, safe areas, touch targets, and breakpoints.
What this file does
Documents mobile-first responsive design and iOS-specific optimizations for a React UI kit, covering viewport, safe areas, touch targets, and breakpoints.
When to use it
- Building a mobile-responsive web app with notch support
- Optimizing a React app for iOS Safari and touch interactions
- Setting up responsive breakpoints and safe area CSS variables
- Ensuring touch targets meet Apple HIG minimum sizes
Assumes this stack
Mobile Constraints & iOS Optimization
Overview
The application has been fully optimized for mobile devices, including iOS with notch support. All pages now render responsively on screens from 320px to 1920px width.
Key Improvements
1. HTML Viewport & Meta Tags (index.html)
- Enhanced viewport meta tag with
viewport-fit=coverfor notch/safe area support - Apple-specific meta tags for iOS web app capabilities
- Progressive enhancement with safe area CSS variables
- Font smoothing and antialiasing for crisp text rendering
- Prevent double-tap zoom delays with
touch-action: manipulation
2. Mobile-Safe Styling
Safe Area Support:
- Automatically adjusts padding for devices with notches
- Uses CSS env() variables for safe-area-inset-*
- Maintains proper spacing around device features
3. Responsive Breakpoints
Mobile-First Approach
- Base (< 768px): Mobile phones and small tablets
- Tablet (768px - 1024px): Tablets and large phones
- Desktop (≥ 1024px): Desktop and large screens
4. Page-Specific Optimizations
LoginPage.tsx
- Desktop: Split layout (branding left, form right)
- Mobile: Stacked layout (branding top, form bottom)
- Padding: 60px → 24px on mobile for better space usage
- Form width: Responsive from 100% on mobile to 500px on desktop
RegisterPage.tsx
- Multi-step form optimized for mobile
- Desktop: Side-by-side layout with branding
- Mobile: Full-width form without branding section
- Touch-friendly inputs: Minimum 44px height on mobile devices
DashboardPage.tsx
- Stats grid: 3 columns → 2 columns → 1 column based on width
- Feature cards: Responsive grid with mobile-first design
- Typography: Font sizes scale from 16px to 36px
- Padding: Reduces from 32px to 20px on mobile
MainLayout.tsx
- Sidebar: Fully hidden on mobile, collapsible drawer navigation
- Mobile menu toggle: Hamburger icon visible only on mobile
- Responsive sidebar width: 256px (desktop) → 80px (tablet) → hidden (mobile)
- Safe area integration for notched devices
- Overlay backdrop when mobile menu is open
5. Input & Button Constraints
Mobile Input Handling
- Minimum font size: 16px (prevents auto-zoom on iOS)
- Minimum height: 44px (Apple HIG standard)
- Full-width on mobile for easier interaction
- Disabled double-tap zoom delays
Touch Targets
- All interactive elements ≥ 44x44px on mobile
- Adequate spacing between buttons (min 12px gap)
- Proper padding for comfortable touch interaction
6. Performance Optimizations
- Smooth scrolling with GPU acceleration
- Reduced motion support for battery efficiency
- Optimized reflows with proper CSS containment
- Viewport height fixes using
100vhwith safe area adjustments
7. iOS-Specific Features
- Status bar styling:
black-translucentfor immersive experience - Web app title: Customized for home screen icon
- Theme color: Matches brand colors
- Notch support: Safe area variables prevent content overlap
8. Responsive Tables & Lists
- Tables collapse to single column on mobile
- Data attributes show labels on mobile
- Horizontal scroll with proper touch handling
- Optimized density for different screen sizes
9. Testing Recommendations
iOS Devices
- iPhone 13 mini (375px) - smallest
- iPhone 13 Pro Max (428px) - largest phone
- iPad (810px) - tablet
- iPad Pro (1024px+) - large tablet
Testing on Desktop
Chrome DevTools → Toggle device toolbar
- iPhone SE: 375x667
- iPhone 12 Pro: 390x844
- iPad: 810x1080
- iPad Pro: 1024x1366
Breakpoint Reference
// Mobile-first media queries
< 480px - Extra small phones
480-768px - Small tablets
768-1024px - Tablets
> 1024px - Desktop
CSS Considerations
SafeArea Integration
@supports (padding: max(0px)) {
body {
padding: max(0px, env(safe-area-inset-*));
}
}
Responsive Grid
grid-template-columns:
1fr /* Mobile */
repeat(2, 1fr) /* Tablet */
repeat(3, 1fr) /* Desktop */
Browser Support
- iOS 11+ (safe area support)
- Android 5+
- Modern browsers with viewport meta tag support
- Graceful degradation for older devices
Known Constraints
- Sidebar on Mobile: Hidden by default, toggle via menu button
- Feature Grids: Single column on mobile for better readability
- Desktop Features: Some features (side panels) hidden on mobile
- Gesture Handling: Touch-optimized interfaces
Future Enhancements
- PWA support with service workers
- Offline mode
- Bottom navigation for mobile (alternative to sidebar)
- Dark mode toggle persistence
- Haptic feedback for actions
- Gesture-based navigation
Deployment Checklist
- ✅ Viewport meta tags correct
- ✅ Safe area CSS variables applied
- ✅ Touch targets ≥ 44px
- ✅ Font sizes ≥ 16px on inputs
- ✅ Responsive grids configured
- ✅ Hamburger menu implemented
- ✅ No horizontal scroll on mobile
- ✅ Form inputs full-width on mobile
- ✅ Images responsive with proper sizing
- ✅ Tested on actual iOS device
Resources
What's inside
9 sections covering viewport meta, safe area CSS, breakpoints, page-specific optimizations, input constraints, performance, iOS features, testing, and deployment checklist.
Change this for your project
- Replace brand colors in
theme-colormeta tag with your own - Replace
Web app titlevalue with your app's name - Replace page component names like
LoginPage.tsx,RegisterPage.tsx,DashboardPage.tsx,MainLayout.tsxwith your own
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Using
env(safe-area-inset-*)with@supportsfor notch-safe padding - Collapsing sidebar to hidden drawer with hamburger toggle on mobile
- Setting minimum input font size to 16px and touch target to 44px to prevent iOS zoom
Related Documents
DunApp PWA - Project Constraints
Defines 14 hard constraints for a Hungarian PWA project, banning Netlify deployment and enforcing local-only testing, Supabase backend, and zero-cost development.
Constraints
Defines a three-tier priority system for design decisions, with conflict resolution examples to guide trade-offs.
Version Constraints Guide
Teaches Composer version constraint syntax for WordPress plugins and themes using a custom shell script wrapper.
Specifying version constraints
Explains how to pin Terraform CLI, provider, and Ansible versions for IBM Cloud Schematics workspaces and actions.