UI & layoutBeginner5h

Styling & themes.

StyleSheet, design tokens, dark mode, and consistency.

What is styling in React Native?

React Native styles look like CSS but are JavaScript objects, applied via the style prop and organized with StyleSheet.create. There is no cascade and no class names — styles are explicit and local. Themes and design tokens bring consistency across the app.

Why it matters

Consistent, themeable styling is what makes an app feel polished and professional rather than thrown together. Dark mode is now an expectation, not a bonus. Building a token-based theme early saves you from scattered, inconsistent styles that are painful to change later.

What to learn

  • The style prop and StyleSheet.create
  • Differences from CSS: camelCase, no cascade, units
  • Composing and merging style arrays
  • Design tokens for color, spacing, and type
  • Light and dark mode with useColorScheme
  • A theme provider or context
  • Styling libraries when they help

Common pitfall

Hardcoding colors and spacing as magic numbers scattered across components. When the brand color or spacing scale changes, you hunt through every file, and dark mode becomes nearly impossible. Define tokens once and reference them everywhere, so a theme change is a single edit and dark mode is a swap.

Resources

Primary (free):

Practice

Define a small theme: tokens for a few colors, spacing steps, and font sizes. Style a screen using only those tokens, then add dark mode with useColorScheme swapping the color tokens. Done when toggling the device to dark mode restyles the screen with no hardcoded colors left.

Outcomes

  • Style components with StyleSheet and the style prop.
  • Organize design tokens for color, spacing, and type.
  • Implement light and dark mode.
  • Keep styling consistent and themeable.
Back to Mobile roadmap