Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

250
Views
How do I get this progress bar from react native?

enter image description here

Whole Screen So I want to implement a progress bar like this in react native. I have found a library which is https://www.npmjs.com/package/react-native-progress, but this library does not have a progress bar like this. The issue is the circle part. Is there a library which has a progress bar like this one? If there isn't, then any idea on how to implement this would be appreciated. So as a fellow commenter got confused whether it is a slider or progress bar, I will include the full screen image. There is a timer and the progress bar or progress slider reflects that in real time.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

We can still exploit react-native-community/slider for this purpose. This would make sense since we can allow the user to fast forward. If you do not want allow user interaction, you can still disable it via the slider component props.

For a smooth sliding, the slider changes its value at a higher tick rate. You might want to experiment with it a little bit to make it fit your needs.

Here is an example on how I did it.

const [progress, setProgress] = useState(-1)

// takes time in seconds
function interpolate(time) {
  return time * 600
}

// runs 10 seconds, you can take any other value
const [time, setTime] = useState(interpolate(10))

useEffect(() => {
  if (progress < time && progress > -1) {
    const timer = setTimeout(() => setProgress(progress + 10), 10)
    return () => clearTimeout(timer)
  }
}, [progress, time])

const startTimer = React.useCallback(() => {
  setProgress(0)
}, [])

return (
  <SafeAreaView style={{ margin: 30 }}>
    <Slider
      style={{ width: 300, height: 40, backgroundColor: "red" }}
      value={progress}
      minimumValue={0}
      maximumValue={time}
      minimumTrackTintColor="#FFFFFF"
      maximumTrackTintColor="#FFFFFF"
    />
    <Pressable style={{ marginTop: 10 }} onPress={() => startTimer()}>
      <Text>Toggle timer</Text>
    </Pressable>
  </SafeAreaView>
)

The above is a dummy implementation which will run a timer for 10 seconds and the slider will move automatically like a progress bar.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!