nirsky / react-native-size-matters

A lightweight, zero-dependencies, React-Native utility belt for scaling the size of your apps UI across different sized devices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: How do you choose `@s`, `@ms` & `@vs`?

deadcoder0904 opened this issue · comments

There must be a trick, right? Or trial & error?

  1. How do you go about choosing when to use scale, moderateScale & verticalScale?

  2. What properties should be used for this library? Should we use margin, padding, fontSize, etc..? What exact properties? Also, when to go with Flexbox? Or is it still lots of trial & error?

Hey @deadcoder0904,
This is mostly trial and error and depends on the design you aiming for.
I use it mainly for properties like margin, padding, fontSize, width and height, and use most of the time moderateScale.
You should definitely combine it with flex, and use flex for you layout.

The blog post in this repo has some good explanation and can help sort things out.