<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shane Rudolf on Medium]]></title>
        <description><![CDATA[Stories by Shane Rudolf on Medium]]></description>
        <link>https://medium.com/@shanerudolfworktive?source=rss-7b8a586cdac6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*48rGy0PRTmU1Srfw.</url>
            <title>Stories by Shane Rudolf on Medium</title>
            <link>https://medium.com/@shanerudolfworktive?source=rss-7b8a586cdac6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 07:04:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shanerudolfworktive/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[React Native Super Blazing Fast UI Building Techniques Part 1 — Storybook]]></title>
            <link>https://medium.com/@shanerudolfworktive/react-native-super-blazing-fast-ui-building-techniques-part-1-storybook-108627296ab0?source=rss-7b8a586cdac6------2</link>
            <guid isPermaLink="false">https://medium.com/p/108627296ab0</guid>
            <category><![CDATA[ui-development]]></category>
            <category><![CDATA[storybook]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Shane Rudolf]]></dc:creator>
            <pubDate>Mon, 07 May 2018 07:26:51 GMT</pubDate>
            <atom:updated>2018-05-07T07:26:51.451Z</atom:updated>
            <content:encoded><![CDATA[<p>*** To Be Revised***</p><p>Ever since I moved from Native development to React Native, I’ve been loving every aspect of it. Especially the use of storybook and not to mention, the <strong>live update using Code Push</strong>.</p><h3>So, what is Storybook? 🤔</h3><p><em>Storybook is like an interface builder that </em><strong><em>runs outside of your app, </em></strong><em>which allows you to </em><strong><em>document all your UIs, apply API design first principle, build ultra reusable components, and manage large amount of components</em></strong><em>.</em></p><p>Much like the xml layout in Android or Storyboards in iOS, but much better ✨!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*s5jCPfeITUbNCCCZsntXCg.png" /></figure><h3>Why storybook is great for documentation?🤔</h3><p>For one thing, you can browse all the components to see what can be reused. 👇👇👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*vzX3oCw0Ikr6Tu0CUIsgJg.png" /></figure><p>And another, you can play around with the component API and see live changing result using <a href="https://github.com/storybooks/storybook/tree/master/addons/knobs">Knobs</a>. 👇👇👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D1IP39_obt5724x30M59XQ.gif" /><figcaption>just by looking, we know that CircleImage has three APIs, and we can change them to see how it looks like! 😄</figcaption></figure><h3>How to Apply API First Design Principle?🤔</h3><p>One important property of storybook is that it runs outside of your app. <em>Which means, </em><strong><em>storybook components should never know how your data model looks like, it simply renders what ever you tell it to render. </em></strong>For example: you want to render a player’s last name and first name 👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XBokEf3Nch7t_a7tmyVQtw.png" /><figcaption>How to applied API first design Principle? 🤔</figcaption></figure><p>Well, we simply pretend that we don’t know anything about the data model before we build the component. 👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0dttSy33MQY2ZbxwSmOuXw.png" /><figcaption>Steps: define API -&gt; build model -&gt; use API ✅</figcaption></figure><blockquote><strong>Why is this good🤔?</strong></blockquote><blockquote>First, it makes your component flexible. For example, if I don’t want to render last name at all, I can simply just pass first name to it.</blockquote><blockquote>Second, it makes your component RankCard intuitive. Meaning, if someone trying to use this component. They don’t need to know your the dataModel you had. They simply know whatever they pass intitle, it’ll render there!</blockquote><p>And here is the wrong way to do it 🚫.👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9uKTqTYZLMOwxyifyWjJCw.png" /><figcaption>Wrong steps: define data model -&gt; build component with data model 🚫-&gt; manipulate data in component 🚫</figcaption></figure><p>Seems pretty simple uhu? But trust me, I’ve seen more than a dozen of developers made that mistakes, including myself 😅.</p><h3>How Storybook manage many components?🤔</h3><p>Subdirectories is the key to manage large amount of components. 👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*za00RW8LZNEu3zJun4JHeQ.png" /></figure><h3>How to browse in large amount of components?🤔</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*-MJd_tykxxkFAeut2aomFg.png" /></figure><h3>How is it more reusable?🤔</h3><p>This is entirely depend on the scope of the your project and the company.</p><p>If there is only one app you develop, then simply had one storybook per app in the app folder is sufficient.</p><p>If your company develop multiple projects, then below architecture will be more useful. 👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_HTW_250ONE-AnUca7gh2g.png" /></figure><p>You might asked, how will these component gets imported in each project? One way to do is leveraging the npm packaging. But that is another topic (sorry no time left this weekend ☹️, but you can check out how to <a href="https://www.youtube.com/watch?v=BkotrAFtBM0">publish </a><a href="https://www.youtube.com/watch?v=BkotrAFtBM0">npm package here</a>)</p><h3>How Storybook make testing like a breeze?🤔</h3><p>Since you are now a React Native developer, your component will need to adapt much broader devices and screen sizes, not only just Android or iOS. Being able to test efficiently will be a critical factor for your success.</p><p>So, to test the scalability of your components, you can leverage the <a href="https://github.com/storybooks/storybook/tree/master/addons/viewport">power of ViewPort</a>. It can be a life saver for your QAs 😄. Here is how it looks like. 👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/315/1*O1umb8dG5zC328Yy_wHVgA.gif" /><figcaption>You can define different screen sizes and test it on iPad Pro 😃</figcaption></figure><p>(Please note, some how I couldn’t get the ViewPort Add-on to work. I’m not sure if they have added the support for React-Native. The above example is a simple demo I wrote to demonstrate how it works. It is not production ready at all, if you were to use, please use with caution.)</p><p>Also, you can view lift Jest result with the <a href="https://github.com/storybooks/storybook/tree/master/addons/jest">Jest add-on</a>. Please stay tune for the upcoming tutorial — 10 Scenarios to have your Unit Test 100% covered using Jest and Enzyme.</p><h3><strong>Conclusion</strong></h3><p>Thank you for making to the end of this blog. I know there are some imperfections and it’ll need to be revised, but I hope you learned something useful. Please leave a comment if you have any suggestions or point out if I made any mistakes. I will be very grateful for that.</p><p>As always, here is the full working code <a href="https://github.com/shanerudolfworktive/ReactNativeStorybookTutorial/tree/master">https://github.com/shanerudolfworktive/ReactNativeStorybookTutorial/tree/master</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=108627296ab0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 Tips to Develop React Native UIs For All Screen Sizes]]></title>
            <link>https://medium.com/@shanerudolfworktive/7-tips-to-develop-react-native-uis-for-all-screen-sizes-7ec5271be25c?source=rss-7b8a586cdac6------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ec5271be25c</guid>
            <category><![CDATA[all-screens]]></category>
            <category><![CDATA[different-screen]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[tips-and-tools]]></category>
            <dc:creator><![CDATA[Shane Rudolf]]></dc:creator>
            <pubDate>Sun, 15 Apr 2018 22:30:35 GMT</pubDate>
            <atom:updated>2018-04-22T17:38:00.390Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*kyRgd7i1RjZhFekuxZAJyQ.png" /><figcaption><strong>Build that Piece of UI 😵!</strong></figcaption></figure><p>So your team decided to move the mobile stack to React-Native and your designer have gave you a piece of UI. Left you ponder <strong>how to made that UI fit for all the devices available on Android and iOS 🤔</strong>. Look no further, in this article, I’ll share 7 tips to make you fall in love with the amazing UI designing style in React Native!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uX_b2Yz-esJ7IqieCgtzyg.png" /><figcaption><strong>How to scale my components to fit all screen sizes 🤔?</strong></figcaption></figure><h3>Proportion is the key</h3><p>Human eyes are automatically capture things that stands out and our poor designers spend their days and nights making sure important information catches users attention. We as a developer, <strong>wanted to make sure we conveys that information regardless the Screen Sizes and Resolutions.</strong></p><h3>Ruler!</h3><p>Before anything, <strong>make sure you get a </strong><a href="https://chrome.google.com/webstore/detail/page-ruler/jlpkojjdgbllmedoapgfodplfhcbnbpn?hl=en"><strong>ruler</strong></a><strong>. It’ll help you measure the proportion along the way</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6zswb2uQwG_8Cf8pxTjqJw.png" /><figcaption><strong>After using the rulers, we can generate the ratios on the far right ✋</strong></figcaption></figure><h3><strong>Tip 1: Percentage (%)</strong></h3><p><strong>We want to use percentage whenever possible, </strong>because it is the most scalable element. In this case we want the entire box to match the whole width of the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3_cO1XePgPXswyUeCvh6qQ.png" /></figure><p>Some might ask, why not use flex. Two reasons. First, use % you are being explicit<strong> </strong>that you want the width to match 100% of the parent. Second, depends on the flexDirection, flex can span full width or full height.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PSabPDrO21ycXadsQho2Ig.png" /></figure><h3>Tip 2: AspectRatio</h3><p>Remember the keyword <strong>Proportion. </strong>Now we know the width<strong>, we gonna use aspectRatio to set the height, or vice versa</strong>. (Note: aspectRatio is ONLY<strong> </strong>in React-Native, NOT<strong> </strong>a css standard).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_rPTQPSoRskiN7PLhofKpQ.png" /><figcaption><strong>With percentage and aspectRatio, we get the desired proportional width and height that are scalable!!!</strong></figcaption></figure><h3>Tip 3: Flex</h3><p>Flex should be your third choice when developing your width and height, which means <strong>use flex only for the jobs percentage(%) can’t do.</strong> For example, we want to make each rankRow has the same height, regardless the number of rows. Percentage is impossible to do the job because we don’t know the number of rows before-hand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zz59qYTubY1Uy53r-Vj5Og.png" /><figcaption><strong>No matter how many rows added, every row will have the same height by using Flex 😬</strong></figcaption></figure><p>Another example is when division is an infinite decimal. In our case, the proportion between left and right box is 11:17. If we were using percentage, left container would be 11/(11 + 17) = 0.392857143% 🤔.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*rX08FmJeuiE6oBajh5T_3A.png" /><figcaption><strong>We can not divide the number into an whole integer, so we use flex instead</strong></figcaption></figure><p>In this case, we have to use Flex (Note: I’m not sure if react-native will rounded to nearest value or not 😝).</p><h3>Tip 4: REM</h3><p>Finally, we come to the <strong>core of this tutorial</strong>!!! So stop snoo💤!!!</p><p>We now know how to scale the width and height, but how about texts 🤔? The core react-native StyleSheet doesn’t support any kind of fontSize scales.</p><p>Good news is we have an open source project <a href="https://github.com/vitalets/react-native-extended-stylesheet">Extended StyleSheet</a> that has the support for rem, which can be used as fontSize: “11rem”.</p><p>So what is rem 🤔? <strong>REM</strong> is a <strong>scale factor. </strong>For example, if your rem is 2 and your “11rem” will become “11*2” = “22” . Why is this important 🤔? Well, remember Proportion<strong>?</strong> <strong>If we make the scale factor relative to the screen size, it’ll make all our elements that used </strong><strong>rem scaled proportionally</strong>!</p><p>In this project, we first define our rem scale factor relative to the entire screen width EStyleSheet.build({<strong>$rem</strong>: entireScreenWidth / 380}); . Of course, 380 is a magic number, it works well for this tutorial. In production though, you might want to do more calculation or even exposed it as an option for users, because some people who have bad vision might prefer to read bigger texts!</p><pre><strong>const </strong>entireScreenWidth = Dimensions.<em>get</em>(<strong>&#39;window&#39;</strong>).<strong>width</strong>;<br>EStyleSheet.build({<strong>$rem</strong>: entireScreenWidth / 380});</pre><p>Now everything is straight forward. Just apply every rem to all your pixels numbers. <strong>Make it look good in one screen and it’ll look good on all screens 😄.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E_mLV2amVJkxCOIOrkkI3A.png" /></figure><p>Moreover, rem not only works for fontSize, every pixel you used can leverage the power of rem . For example, padding, margin, width, height and more. one more time! <strong>Make it look good in one screen and it’ll look good on all screens 😄.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-y2Knvl68gSM_mpexuC_UQ.png" /><figcaption><strong>apply paddings to width, height, and paddings</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YMDgXSBf_fZXfbvXnR8O9A.png" /><figcaption><strong>Here is a comparison using </strong><strong>rem and not using </strong><strong>rem when running on iPad Pro 2. ❌</strong></figcaption></figure><p>Once again, here is how rem looks looks on different screen sizes in <strong>android and iOS.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uX_b2Yz-esJ7IqieCgtzyg.png" /><figcaption><strong>look how nice it scales in all screen size! 😄</strong></figcaption></figure><h3>Tip 5: ScrollView</h3><p>ScrollView is your friend when dealing with texts, because your text’s length could be vary. So, <strong>embedded your text inside a ScrollView is always a good idea</strong>, in case your text is longer than its container box.</p><h3>Tip 6: Pixels</h3><p>I put pixels last because it should be the Absolute Least<strong> </strong>element you consider! I would say<strong> 99% of the time, you want to use the techniques above for scalability</strong>. Of course there are things like, all I want to do is to add 2 pixel paddings for the scrollBar or the shadows.</p><h3>Tip 7: Let me know other great tricks PLEASE😜</h3><p>Thank you for making to the end of this blog. I hope you learned something useful. Please leave a comment if you have any suggestions or point out if I made any mistakes. I will be very grateful for that.</p><p>As always, here is the full working code <a href="https://github.com/shanerudolfworktive/ScalableLayoutTutorial">https://github.com/shanerudolfworktive/ScalableLayoutTutorial</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ec5271be25c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>