Skip to main content
This guide explains how to make your app responsive to different screen sizes, especially for smaller Android phones.

Quick Start

Screen Size Categories

  • Small: < 375px (iPhone SE, small Android phones)
  • Medium: 375px - 414px (most iPhones, standard Android)
  • Large: > 414px (iPhone Pro Max, large Android phones)

Available Hooks

useResponsive()

Main hook that provides all responsive utilities:

Responsive Values

Padding

Values:
  • xs: 8-12px (small-medium-large)
  • sm: 12-16px
  • md: 16-24px
  • lg: 20-28px
  • xl: 24-32px
  • 2xl: 28-40px

Font Sizes

Values:
  • xs: 10-12px
  • sm: 12-14px
  • md: 14-16px
  • lg: 16-18px
  • xl: 20-24px
  • 2xl: 24-28px
  • 3xl: 28-32px
  • 4xl: 32-36px

Spacing

Values:
  • xs: 4-6px
  • sm: 8-10px
  • md: 12-16px
  • lg: 16-20px
  • xl: 20-24px
  • 2xl: 24-32px
  • 3xl: 32-40px

Examples

Example 1: Responsive Screen

Example 2: Conditional Rendering

Example 3: Custom Scaling

Migration Guide

Before (Fixed Sizes)

After (Responsive)

Or with StyleSheet:

Best Practices

  1. Use responsive values for padding/margins: Always use padding.md, spacing.lg, etc. instead of fixed values
  2. Use responsive font sizes: Use fontSize.xl instead of fixed fontSize: 20
  3. Test on different screen sizes: Test on small (< 375px), medium (375-414px), and large (> 414px) screens
  4. Use conditional rendering for complex layouts: Use isSmall, isMedium, isLarge for layout changes
  5. Scale custom values: Use scaleFont() and scaleSize() for one-off custom values

Common Patterns

Responsive Header

Responsive List

Responsive Card