Skip to main content
Version: 0.62


A StyleSheet is an abstraction similar to CSS StyleSheets

Code quality tips:

  • By moving styles away from the render function, you're making the code easier to understand.
  • Naming the styles is a good way to add meaning to the low level components in the render function.







static create(obj: object): object

Creates a StyleSheet style reference from the given object.


static flatten(style: array<object>): object






static setStyleAttributePreprocessor(property: string, process: (propValue: any) => any)








This is defined as the width of a thin line on the platform. It can be used as the thickness of a border or division between two elements. Example:

This constant will always be a round number of pixels (so a line defined by it can look crisp) and will try to match the standard width of a thin line on the underlying platform. However, you should not rely on it being a constant size, because on different platforms and screen densities its value may be calculated differently.

A line with hairline width may not be visible if your simulator is downscaled.

absoluteFill vs. absoluteFillObject#
