filmov
tv
React Native Animated Counter
Показать описание
🔥 In this video tutorial we will create a custom animated counter component built with React Native Moti and powered by React Native Reanimated! It’s super customizable and comes packed with cool features:
- Stagger Functionality: Easily tweak the stagger animation to match what you need.
- Responsive Layout: No more worrying about the text not fitting—this counter adjusts to always stay within its space using onTextLayout.
- i18n Support: Got users from different regions? This counter’s got internationalization covered.
- Written in TypeScript
It’s the perfect addition for adding smooth, animated counters to your React Native app!
----
----
You can find me on:
---
Timeline:
00:00 Welcome and what we’ll build
00:35 VSCode and start coding
00:54 How to approach a Ticker component animation
03:00 Create the Vertical list for scrolling to the active number
04:12 Why a Vertical List and translateY
06:00 Create the cell container and overflow:hidden
07:48 fontVariant - tabular-nums - what it means
09:38 scroll to each number inside the vertical list
10:35 use Moti to animate the new state changes
11:39 Why the animation is not working and how to fix it
13:10 Apply a Stagger animation to each Number within the list
15:05 Fix the Text size when it will not fit inside the screen width
17:00 Apply numberOfLines and adjustFontSizeToFit
17:29 Get the Text layout and size via onTextLayout
19:20 Recalculate font size based on onTextLayout
19:50 Use Intl.NumberFormat to display it as currency
#react-native-reanimated #react-native-animation #react-native-counter #react-native-text-animation #react-native-stagger #reanimated-stagger #react-native-moti #reanimated-sequence
- Stagger Functionality: Easily tweak the stagger animation to match what you need.
- Responsive Layout: No more worrying about the text not fitting—this counter adjusts to always stay within its space using onTextLayout.
- i18n Support: Got users from different regions? This counter’s got internationalization covered.
- Written in TypeScript
It’s the perfect addition for adding smooth, animated counters to your React Native app!
----
----
You can find me on:
---
Timeline:
00:00 Welcome and what we’ll build
00:35 VSCode and start coding
00:54 How to approach a Ticker component animation
03:00 Create the Vertical list for scrolling to the active number
04:12 Why a Vertical List and translateY
06:00 Create the cell container and overflow:hidden
07:48 fontVariant - tabular-nums - what it means
09:38 scroll to each number inside the vertical list
10:35 use Moti to animate the new state changes
11:39 Why the animation is not working and how to fix it
13:10 Apply a Stagger animation to each Number within the list
15:05 Fix the Text size when it will not fit inside the screen width
17:00 Apply numberOfLines and adjustFontSizeToFit
17:29 Get the Text layout and size via onTextLayout
19:20 Recalculate font size based on onTextLayout
19:50 Use Intl.NumberFormat to display it as currency
#react-native-reanimated #react-native-animation #react-native-counter #react-native-text-animation #react-native-stagger #reanimated-stagger #react-native-moti #reanimated-sequence
Комментарии