HOME
|
COMMUNITY
|
BLOG
|
ReanimatedArc - Build Circular Animated UI Elements in React Native

ReanimatedArc - Build Circular Animated UI Elements in React Native

In short

ReanimatedArc is a React Native library for creating smooth animated arcs with native performance. It enables building circular progress bars, donut charts, time displays, and rounded sliders with ease. The library supports animations and gesture control, making it versatile for various applications, including banking, sports, Smart Home, or diet apps. Check out the GitHub repository and enhance your UI with sleek animated arcs using ReanimatedArc.

Build good-looking and smooth animated arcs in React Native with ReanimatedArc library

Circular UI elements are a common pattern in many modern apps. They are usually used to indicate some kind of progress, for example

  • your bank account balance,
  • time passing on a stopwatch in your smartphone,
  • macronutrient ratio in your diet,

and many more.

They are used whenever we want to show that something is a part of the whole. A circle seems to be the most natural way of representing this relationship.

However, rendering a circle is not trivial in <rte-code>react-native<rte-code>. One of the possibilities is to use <rte-code>react-native-svg<rte-code> with some math calculations. But what if we also want to:

  • Animate our arc
  • Animate it with native performance
  • Control the progress with gestures

This is when our new library - ReanimatedArc comes into play.

ReanimatetdArc for the rescue!

Reanimated-arc is a utility component to build various UI elements that consist of arcs with the ability to animate the rendered arc. You can use a high-level wrapper that would animate the arc based on prop value change or low-level component to control your animation with react-native-reanimated. It can be also combined together with react-native-gesture-handler to build outstanding sliders. Also, thanks to the ReanimatedArc library the animations are very smooth.

Now, let's find out what we can build with the new library!

Circular Progress Bar

This is the most obvious usage of ReanimatedArc. To build circular progress we have to combine two arcs:

  • the first will be used for background
  • the second will be used to indicate progress.

We will interpolate an animated value into the text to show the percentage of the progress. This example can be found in the repository.

gif presenting circular progress bar made with ReanimatedArc library

Donut chart

Donut charts are a great way of representing various kinds of data. For example, it may show macronutrients in a particular meal in some health apps. Also, it can display the ratio of your spendings in a particular month compared to the remaining funds in your bank’s app. The example below shows a nicely animated donut chart.

gif presenting donut chart made with ReanimatedArc library

Displaying time

What’s more, ReanimatedArc allows you to build a simple stopwatch. This type of chart can also be used in various projects like, for example, workout apps.

gif presenting stopwatch made with ReanimatedArc library

Rounded slider

The rounded slider is commonly used as a component for adjusting some settings. Let's imagine that you have a Smart Home. Your smartphone is a command center in your hand. One of your smart devices is a light bulb with adjustable brightness. Imagine how awesome it would be to dim your light with a nice-looking rounded slider… No problem. Check slider implementation .

gif presenting rounded slider made with ReanimatedArc library

Summary

To sum up, ReanimatedArc library allows you to build good-looking and smooth animated arcs. They can be used in many different types of applications such as banking, sports, Smart Home or diet apps. I hope that this library will be helpful to you. If you like the project don't forget to give it a star on GitHub.

Happy Coding!

FAQ

No items found.
React Galaxy City
Get our newsletter
Sign up

By subscribing to the newsletter, you give us consent to use your email address to deliver curated content. We will process your email address until you unsubscribe or otherwise object to the processing of your personal data for marketing purposes. You can unsubscribe or exercise other privacy rights at any time. For details, visit our Privacy Policy.

Callstack astronaut
Download our ebook
Download

I agree to receive electronic communications By checking any of the boxes, you give us consent to use your email address for our direct marketing purposes, including the latest tech & biz updates. We will process your email address and names (if you have entered them into the above form) until you withdraw your consent to the processing of your names, or unsubscribe, or otherwise object to the processing of your personal data for marketing purposes. You can unsubscribe or exercise other privacy rights at any time. For details, visit our Privacy Policy.

By pressing the “Download” button, you give us consent to use your email address to send you a copy of the Ultimate Guide to React Native Optimization.