Responsive & Adaptive Screens

Support different screen sizes, orientations, safe areas, tablets, foldables, font scaling and dark mode.

Intermediate · about 6 hours · difficulty 3/5

Learn first: Layout Systems: Flexbox, Rows, Columns & Stacks

Your app will run on a 4.7-inch phone with huge system fonts, a 6.9-inch phone, a tablet in landscape and possibly a foldable. Responsive design here means more than media queries.

What to handle

  • Safe areas: notches, the Dynamic Island, rounded corners and gesture bars. Use SafeAreaView/react-native-safe-area-context, Flutter's SafeArea, Compose window insets, or SwiftUI's built-in safe area handling.
  • Density-independent units: dp/pt, not physical pixels.
  • Font scaling: test at the largest accessibility text size. Text must wrap, not get clipped.
  • Orientation and window size: read the window dimensions (useWindowDimensions, MediaQuery, WindowSizeClass, horizontalSizeClass) and switch layouts, for example a list on phones and list-detail side by side on tablets.
  • Keyboard: avoid inputs hidden behind the keyboard (KeyboardAvoidingView, insets).
  • Dark mode: follow the system appearance by default via your theme.

Adaptive vs responsive

Responsive stretches the same layout; adaptive swaps to a different layout at breakpoints. Tablets usually deserve adaptive layouts.

Good enough to move on: your main screens survive a small phone, a tablet, landscape, largest font size and dark mode without clipping.

Key concepts

  • Safe areas and insets
  • Density-independent units
  • Font scaling
  • Window size classes and breakpoints
  • Orientation changes
  • Keyboard avoidance
  • Dark mode
  • Foldables and multi-window

Mini project

Build an email-style app that shows a list on phones and a two-pane list-detail layout on tablets, and handles dark mode and large text.

Check yourself

Your login button disappears behind the keyboard on small Android phones. What are two ways to fix it?

Free resources