The View Component as a Container
Use View as the primary layout container, nesting multiple Views to build structured screens and understanding how it maps to native UI boxes.
What Is the View Component?
Meet View — the basic box you build every screen with. It is a rectangle that holds other components, mapping to a real native box on iOS and Android.
import { View, Text } from 'react-native';
export default function App() {
return (
<View>
<Text>I am inside a View!</Text>
</View>
);
}View Maps to Native UI Boxes
Every View you write becomes a real native box on the device — not HTML in a browser. That is why your app feels as smooth as one built in Swift or Kotlin.
import { View, StyleSheet } from 'react-native';
// A simple colored box rendered natively
export default function Box() {
return (
<View style={styles.box} />
);
}
const styles = StyleSheet.create({
box: {
width: 100,
height: 100,
backgroundColor: '#4f86f7',
borderRadius: 12,
},
});All lessons in this course
- The View Component as a Container
- Displaying Text and Styling Fonts
- Showing Images from Local and Remote Sources
- Composing a Simple Profile Card