Lesson 30 of 60 – Designing Mobile UI in React Native
50%

Designing Mobile UI in React Native

Mobile UI means the visual interface that users interact with in a mobile application. A good mobile UI should be simple, clear, responsive, touch-friendly and easy to navigate.

Note: React Native provides components such as View, Text, Image, Pressable, TextInput and ScrollView that can be combined to create complete mobile user interfaces.

1. What is Mobile UI?

Mobile UI is the visual part of a mobile application that users see and interact with.

It includes:

  • Text
  • Buttons
  • Images
  • Forms
  • Cards
  • Menus
  • Navigation
  • Lists

2. Important Parts of Mobile UI

A typical mobile application UI contains several important areas.

Header
   ↓
Content
   ↓
Cards / Forms / Lists
   ↓
Actions
   ↓
Navigation

The exact structure depends on the purpose of the application.

3. View as the Main UI Container

The View component is one of the most important components for creating a mobile UI.

<View style={styles.container}>

    <Text>
        Welcome
    </Text>

</View>

It can be used to group and arrange other components.

4. Creating a UI Header

<View style={styles.header}>

    <Text style={styles.title}>
        My Application
    </Text>

</View>

A header usually contains the screen title, logo, menu or other important actions.

5. Header Styling

const styles = StyleSheet.create({

    header: {
        padding: 20,
        backgroundColor: '#2563EB',
        alignItems: 'center'
    },

    title: {
        fontSize: 22,
        fontWeight: 'bold',
        color: 'white'
    }

});

6. Creating a Content Area

<View style={styles.content}>

    <Text style={styles.heading}>
        Dashboard
    </Text>

    <Text>
        Welcome to your dashboard.
    </Text>

</View>

The content area contains the main information and actions of a screen.

7. Mobile UI Spacing

Proper spacing makes a UI easier to read and interact with.

const styles = StyleSheet.create({

    content: {
        padding: 20
    },

    heading: {
        marginBottom: 15
    }

});

Avoid placing too many elements close together.

8. Typography in Mobile UI

Typography controls how text appears in the interface.

const styles = StyleSheet.create({

    title: {
        fontSize: 24,
        fontWeight: 'bold'
    },

    description: {
        fontSize: 16,
        lineHeight: 24
    }

});

Use larger and stronger text for important headings and readable text sizes for descriptions.

9. Mobile UI Colors

Colors help users understand different sections and actions.

const styles = StyleSheet.create({

    primaryButton: {
        backgroundColor: '#2563EB'
    },

    successButton: {
        backgroundColor: '#16A34A'
    },

    dangerButton: {
        backgroundColor: '#DC2626'
    }

});

Use colors consistently throughout the application.

10. Creating a Button

<Pressable style={styles.button}>

    <Text style={styles.buttonText}>
        Continue
    </Text>

</Pressable>

Buttons should clearly communicate the action they perform.

11. Button Styling

const styles = StyleSheet.create({

    button: {
        backgroundColor: '#2563EB',
        padding: 15,
        borderRadius: 10,
        alignItems: 'center'
    },

    buttonText: {
        color: 'white',
        fontSize: 16,
        fontWeight: 'bold'
    }

});

12. Touch-Friendly UI

Mobile users interact with their fingers. Buttons and interactive elements should therefore have enough space to tap comfortably.

const styles = StyleSheet.create({

    button: {
        paddingVertical: 14,
        paddingHorizontal: 20,
        borderRadius: 10
    }

});

Avoid making important controls extremely small.

13. Creating a Mobile Card UI

<View style={styles.card}>

    <Text style={styles.title}>
        React Native Course
    </Text>

    <Text style={styles.description}>
        Learn mobile application development.
    </Text>

    <Pressable style={styles.button}>

        <Text style={styles.buttonText}>
            Start
        </Text>

    </Pressable>

</View>

14. Using Images in UI

<Image
    source={require('./assets/course.jpg')}
    style={styles.image}
    resizeMode="cover"
/>

Images can be used for logos, profiles, products, courses and banners.

15. Creating a Profile UI

<View style={styles.profile}>

    <Image
        source={require('./assets/user.jpg')}
        style={styles.avatar}
    />

    <Text style={styles.name}>
        Rahul Kumar
    </Text>

    <Text>
        React Native Student
    </Text>

</View>

16. Form UI

<View style={styles.form}>

    <Text style={styles.label}>
        Email
    </Text>

    <TextInput
        style={styles.input}
        placeholder="Enter email"
    />

    <Text style={styles.label}>
        Password
    </Text>

    <TextInput
        style={styles.input}
        placeholder="Enter password"
        secureTextEntry
    />

</View>

Forms should provide clear labels and enough spacing between controls.

17. Input Styling

const styles = StyleSheet.create({

    input: {
        borderWidth: 1,
        borderColor: '#CBD5E1',
        borderRadius: 10,
        padding: 14,
        fontSize: 16,
        marginBottom: 15
    }

});

18. Scrollable Mobile UI

When a screen contains more content than the available height, use ScrollView.

<ScrollView
    contentContainerStyle={{
        padding: 20
    }}
>

    <Text>
        Long mobile content goes here.
    </Text>

</ScrollView>

19. Mobile Dashboard UI

<View style={styles.dashboard}>

    <View style={styles.card}>
        <Text>Students</Text>
        <Text style={styles.number}>
            250
        </Text>
    </View>

    <View style={styles.card}>
        <Text>Courses</Text>
        <Text style={styles.number}>
            12
        </Text>
    </View>

</View>

Dashboard cards can display important statistics at a glance.

20. Row-Based UI

const styles = StyleSheet.create({

    row: {
        flexDirection: 'row',
        alignItems: 'center',
        gap: 12
    }

});

Rows are useful for menus, icons with text, profile information and horizontal actions.

21. Column-Based UI

const styles = StyleSheet.create({

    container: {
        flexDirection: 'column',
        gap: 15
    }

});

Column layouts are commonly used for forms, profiles and vertical content.

22. Responsive Mobile UI

const {
    width
} = useWindowDimensions();

const layout =
    width > 600
        ? 'row'
        : 'column';

The UI can change its layout based on the available screen width.

23. Mobile UI with Safe Areas

Important UI content should not be placed where it can conflict with system areas such as device edges or other system UI.

Safe-area handling is particularly important for headers, navigation controls and other content close to screen edges.

24. Creating a Simple Login UI

<View style={styles.container}>

    <Text style={styles.title}>
        Login
    </Text>

    <TextInput
        style={styles.input}
        placeholder="Email"
    />

    <TextInput
        style={styles.input}
        placeholder="Password"
        secureTextEntry
    />

    <Pressable style={styles.button}>

        <Text style={styles.buttonText}>
            Login
        </Text>

    </Pressable>

</View>

25. Creating a Home Screen UI

<ScrollView>

    <View style={styles.container}>

        <Text style={styles.title}>
            Welcome
        </Text>

        <View style={styles.card}>
            <Text>
                Featured Course
            </Text>
        </View>

        <View style={styles.card}>
            <Text>
                Latest Updates
            </Text>
        </View>

    </View>

</ScrollView>

A home screen normally brings together several UI patterns into one complete screen.

26. Common Mobile UI Mistakes

  • Putting too much information on one screen.
  • Using very small buttons.
  • Using inconsistent spacing.
  • Using too many colors.
  • Using poor text contrast.
  • Making content wider than the screen.
  • Ignoring smaller screens.
  • Not making long screens scrollable.
  • Using unclear button labels.
  • Not testing the UI on different devices.

27. Complete Mobile UI Example

import React from 'react';

import {
    View,
    Text,
    Image,
    Pressable,
    StyleSheet,
    ScrollView
} from 'react-native';

export default function App() {

    return (

        <ScrollView>

            <View style={styles.container}>

                <View style={styles.header}>

                    <Text style={styles.headerText}>
                        Student App
                    </Text>

                </View>

                <View style={styles.profile}>

                    <Image
                        source={require('./assets/user.jpg')}
                        style={styles.avatar}
                    />

                    <Text style={styles.name}>
                        Rahul Kumar
                    </Text>

                    <Text>
                        React Native Student
                    </Text>

                </View>

                <View style={styles.card}>

                    <Text style={styles.cardTitle}>
                        React Native Course
                    </Text>

                    <Text>
                        Learn mobile application development.
                    </Text>

                    <Pressable style={styles.button}>

                        <Text style={styles.buttonText}>
                            Continue
                        </Text>

                    </Pressable>

                </View>

            </View>

        </ScrollView>

    );

}

const styles = StyleSheet.create({

    container: {
        flex: 1,
        padding: 20,
        backgroundColor: '#F8FAFC'
    },

    header: {
        padding: 18,
        borderRadius: 12,
        backgroundColor: '#2563EB',
        alignItems: 'center'
    },

    headerText: {
        color: 'white',
        fontSize: 22,
        fontWeight: 'bold'
    },

    profile: {
        alignItems: 'center',
        marginVertical: 25
    },

    avatar: {
        width: 100,
        height: 100,
        borderRadius: 50,
        marginBottom: 12
    },

    name: {
        fontSize: 22,
        fontWeight: 'bold'
    },

    card: {
        padding: 20,
        backgroundColor: 'white',
        borderRadius: 15,
        borderWidth: 1,
        borderColor: '#E2E8F0'
    },

    cardTitle: {
        fontSize: 20,
        fontWeight: 'bold',
        marginBottom: 10
    },

    button: {
        marginTop: 20,
        padding: 15,
        borderRadius: 10,
        backgroundColor: '#2563EB',
        alignItems: 'center'
    },

    buttonText: {
        color: 'white',
        fontWeight: 'bold',
        fontSize: 16
    }

});

28. Mobile UI Best Practices

  • Keep the interface simple and easy to understand.
  • Use consistent colors throughout the application.
  • Maintain consistent spacing.
  • Use readable typography.
  • Make interactive elements easy to tap.
  • Use responsive layouts.
  • Keep important actions easy to find.
  • Use scrolling when content exceeds the available screen.
  • Give users clear feedback after important actions.
  • Test the interface on different screen sizes.

29. Building Reusable UI Components

Instead of writing the same UI code repeatedly, create reusable components.

function CourseCard({ title, fee }) {

    return (

        <View style={styles.card}>

            <Text style={styles.title}>
                {title}
            </Text>

            <Text>
                Fee: {fee}
            </Text>

        </View>

    );

}

Reusable components make larger applications easier to maintain.

30. Complete Mobile UI Workflow

Plan the Screen
       ↓
Create Main Container
       ↓
Create Header
       ↓
Create Content Area
       ↓
Add Text and Images
       ↓
Create Cards
       ↓
Add Forms or Buttons
       ↓
Add Spacing and Colors
       ↓
Make Layout Responsive
       ↓
Test on Different Screens

A professional mobile UI is created by combining layout, typography, colors, spacing, images, cards, buttons, forms and responsive design. These concepts form the foundation for building real-world React Native applications.

📌 Key Points

  • View is commonly used as the main UI container.
  • Text displays information and labels.
  • Image displays visual content.
  • Pressable can create touchable actions.
  • TextInput is used for forms.
  • ScrollView handles content that exceeds the screen.
  • Flexbox helps organize mobile layouts.
  • Responsive design allows the UI to adapt to different screens.
  • Consistent spacing, colors and typography improve UI clarity.
  • Reusable components make applications easier to maintain.

🧠 Quick Quiz

Question: Which React Native component is commonly used to make a UI element respond to touch interactions?