Question
I have a library that I implemented to use in my frontend projects. (Details are not much relevant, but just in case you may wonder, they are provided below in the Background Info section. I'll be more than happy if more people find it useful.)
Now using this library I want to cover most common usages of native devices (phones, tablets, etc) and common browser usage width/height ratios.
I am not sure if such an information exists. but if so, I'll appreciate if you can point to a relevant study, or provide a list.
Edit 13.10.2022
After receiving some comments let me edit the question to provide some more clarity about what I intent to find. What I hope to find is some statistical information as can be seen from below tables. (The numbers are random, and provided 5 rows is just to show what I am looking for. Of course, ideally, the more rows the better.)
Browser
Least Width/Height | Highest Width/Height | Commonality Ratio |
---|---|---|
0 | 0.5 | 3% |
0.5 | 0.9 | 19% |
0.9 | 1.1 | 25% |
1.1 | 1.5 | 50% |
1.5 | inf | 8% |
Native Device (includes both portrait and landscape orientation)
Least Width/Height | Highest Width/Height | Commonality Ratio |
---|---|---|
0 | 0.5 | 3% |
0.5 | 0.9 | 19% |
0.9 | 1.1 | 25% |
1.1 | 1.5 | 50% |
1.5 | inf | 8% |
Background Info
I have recently implemented a react-native
library (which can also be used by react
projects through react-native-web
). (*)
The logic of the library is, you provide lower and upper bounds with respect to width / height ratio of the screen or browser. And finds the corresponding layout design to use.
For example below configuration says if width/height is between 0 and 0.9 then place 3 div
s in the screen. top
, bottom
, left
, right
represent the coordinates in scale from 0 to 1, where the related div
(or View
in case react-native
) are placed.
[
{
validAfterWHRatio: 0,
validBeforeWHRatio: 0.9,
views: [
{ top: 0, bottom: 0.5, left: 0, right: 1, children: View1 },
{ top: 0.75, bottom: 1, left: 0, right: 1, children: View2 },
{ top: 0.5, bottom: 0.75, left: 0, right: 1, children: View3 },
]
},
...
]
(*)
A web demo is here: https://mehmetkaplan.github.io/react-native-animated-layout/ (you can get the behavior of the library when you resize the browser or change your device orientation landscape - portraid).
The library is here: https://www.npmjs.com/package/react-native-animated-layout