<?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 Jujun Setiawan on Medium]]></title>
        <description><![CDATA[Stories by Jujun Setiawan on Medium]]></description>
        <link>https://medium.com/@jujunsetiawan10?source=rss-ca1060a48ff9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lfqpxCnGjtNrmZF27Hsiiw.png</url>
            <title>Stories by Jujun Setiawan on Medium</title>
            <link>https://medium.com/@jujunsetiawan10?source=rss-ca1060a48ff9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 21:30:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jujunsetiawan10/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[How to Create Progress Bar in REACT NATIVE]]></title>
            <link>https://medium.com/@jujunsetiawan10/how-to-create-progress-bar-in-react-native-f27ae2871ac3?source=rss-ca1060a48ff9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f27ae2871ac3</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[progress-bar]]></category>
            <dc:creator><![CDATA[Jujun Setiawan]]></dc:creator>
            <pubDate>Tue, 20 Dec 2022 07:50:43 GMT</pubDate>
            <atom:updated>2022-12-22T07:18:31.171Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m1c9H70HiBrrR0m4XW1SRA.jpeg" /><figcaption>progress bar</figcaption></figure><h3>What is progress bar ?</h3><p>The progress bar is a user interface (UI) component that is used to show how far a process has been completed. Progress bars are usually displayed as a horizontal line or a circle that shows the percentage of progress. Progress bars are often used in applications to provide feedback to the user about the progress of a process, such as downloading a file, loading a page, or processing data.</p><p>For example, when you download a file from the internet, the application you are using may display a progress bar to show how far the download process has been completed. Progress bars are also often used in applications to show how far a user has completed tasks or how far a user has completed a tutorial or learning process.</p><p>In this tutorial, we’ll learn how to create a progress bar in React Native using built-in components or additional libraries. Without further ado, let’s get started!</p><h3><strong>Create a progress bar with native component</strong></h3><p>You can create your own progress bars using the View dan Animatedcomponents. Animated components allow you to easily animate React Native applications. You can use the width property of a View animated with Animated to create a progress bar. as an example:</p><pre>import React, { useState } from &#39;react&#39;;<br>import { View, Text, StyleSheet, Animated } from &#39;react-native&#39;;<br><br>const ProgressBar = () =&gt; {<br>  const [progress, setProgress] = useState(new Animated.Value(0));<br><br>  useEffect(() =&gt; {<br>    Animated.timing(progress, {<br>      toValue: 75,<br>      duration: 2000,<br>    }).start();<br>  }, []);<br><br>  return (<br>    &lt;View style={styles.container}&gt;<br>      &lt;Animated.View style={[styles.bar, { width: progress }]} /&gt;<br>      &lt;Text&gt;{progress}&lt;/Text&gt;<br>    &lt;/View&gt;<br>  );<br>};<br><br>const styles = StyleSheet.create({<br>  container: {<br>    height: 20,<br>    backgroundColor: &#39;#ccc&#39;,<br>    borderRadius: 10,<br>    margin: 10,<br>  },<br>  bar: {<br>    height: 20,<br>    backgroundColor: &#39;#333&#39;,<br>    borderRadius: 10,<br>  },<br>});<br><br>export default ProgressBar;</pre><p>In the code above, we use Animated.timing() to animate the progress value from 0 to 75 in 2 seconds. Then, we use the progress as the width of the View that displays the progress bar.</p><h3>Create modern progress bar using libraries</h3><p>To create a modern-looking progress bar in React Native, you can use additional libraries such as react-native-progress or react-native-circular-progress.</p><p>Here is an example using react-native-progress:</p><p>To use the react-native-progress library, you need to install it first by running the following command:</p><pre>yarn add react-native-progress</pre><p>or if you use NPM running the following command:</p><pre>npm i react-native-progress</pre><blockquote>You can read and learn more about<em>react-native-progress </em>in the official documentation <a href="https://www.npmjs.com/package/react-native-progress">here</a></blockquote><p>Then, you can add the progress bar to your app by importing the ProgressBar component from the library and using the &lt;ProgressBar&gt; tag. You can adjust the progress and the size of the progress bar by setting the progress and width/height props.</p><pre>import { View } from &#39;react-native&#39;;<br>import ProgressBar from &#39;react-native-progress/Bar&#39;;<br><br>function MyComponent() {<br>  return (<br>    &lt;View&gt;<br>      &lt;ProgressBar progress={0.5} width={200} height={20} /&gt;<br>    &lt;/View&gt;<br>  );<br>}</pre><p>Here, the ProgressBar component has several props that you can adjust:</p><ul><li>progress: determines how far the progress bar has completed. The value can be set between 0 and 1.</li><li>width and height: determine the width and height of the progress bar.</li></ul><p>You can also change the color and style of the progress bar by setting the color and borderWidth props. For example:</p><pre>&lt;ProgressBar progress={0.5} width={200} height={20} color=&quot;#00f&quot; borderWidth={2} /&gt;</pre><p>Another example:</p><pre>import React, { useState } from &#39;react&#39;;<br>import { View, Button, Text } from &#39;react-native&#39;;<br>import ProgressBar from &#39;react-native-progress/Bar&#39;;<br><br>function MyApp() {<br>  const [progress, setProgress] = useState(0);<br><br>  const handlePress = () =&gt; {<br>    setProgress((prevProgress) =&gt; prevProgress + 0.1);<br>  };<br><br>  return (<br>    &lt;View&gt;<br>      &lt;ProgressBar progress={progress} width={200} height={20} /&gt;<br>      &lt;Button onPress={handlePress} title=&quot;Increase progress&quot; /&gt;<br>      &lt;Text&gt;Progress: {(progress * 100).toFixed(0)}%&lt;/Text&gt;<br>    &lt;/View&gt;<br>  );<br>}</pre><p>In this example, the app displays a progress bar and a button. When the button is pressed, the progress of the progress bar is increased by 0.1 (10%). The app also displays the progress value in percentage.</p><p>You can try this example by creating a new React Native project and replacing the default code in the App.js file with the code above. When you run the app, you should see the progress bar and the button. Pressing the button should increase the progress of the progress bar and update the progress value displayed on the screen.</p><p>In conclusion, React Native provides a convenient way to create a progress bar using either a third-party library or by building it yourself using the View and Animated components. Using a library such as react-native-progress or react-native-circular-progress allows for a quick and easy implementation of a progress bar with a modern appearance. Alternatively, using the Animated component allows for the creation of a custom progress bar that can be tailored to fit the specific needs of your application. Regardless of the method chosen, a progress bar is a useful feature to have in any React Native app to display the progress of a task to the user.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f27ae2871ac3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>