StyleSheet

Also called StyleSheet.create, Styling

Updated

What is StyleSheet in React Native?

StyleSheet is React Native’s API for defining styles as JavaScript objects. Styles are plain objects with camelCase properties, not CSS files.

<View>styles.cardpadding: 16styles.activebg: blue{ color }color: blue<Text>{ color }color: blueHello
Style that winsStyle objectColor valueReact Native styles are plain JavaScript objects on the style prop, with camelCase names and density-independent numbers. There is no cascade: in a style array, later entries win, and nothing is inherited, so a color on a View never reaches the Text inside it. Text styles go on the Text. StyleSheet.create is mostly a readability convention now, and tools like NativeWind compile down to these same objects.

StyleSheet is how you style a React Native app. There is no CSS file and no cascade: styles are JavaScript objects attached to a component through its style prop.

const styles = StyleSheet.create({
  card: { padding: 16, borderRadius: 12, backgroundColor: '#fff' },
});

<View style={styles.card} />;

The rules that differ from the web:

  • Property names are camelCase — backgroundColor, not background-color
  • Numbers are density-independent pixels, not CSS px, so padding: 16 scales across screen densities
  • No inheritance. A color on a <View> does not reach the <Text> inside it; text styles must go on the text
  • Arrays compose and later entries win: style={[styles.card, isActive && styles.active]}

StyleSheet.create is largely a validation and readability convention now — plain objects work too.

Many teams instead use NativeWind (Tailwind classes) or Unistyles, both of which compile down to these same style objects. See style.