Styling

suggest change

Introduction

Styles are plain objects whose property names are mostly CSS names in camelCase. Put the object inline on a component's style prop, or pass it to StyleSheet.create and keep the result in a variable, then refer to it by name, similar to a CSS class.

Syntax

Remarks

Most React Native style names are the CSS names written in camelCase. Some names differ. CSS text-decoration is textDecorationLine.

Unlike in CSS, styles do not get inherited. If you want child components to inherit a certain style, you must explicitly provide it to the child. This means that you cannot set a font family for an entire View.

The one exception to this is the Text component: nested Texts inherit their parent styles.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents