
Security News
Meet the Socket Team at RSAC and BSidesSF 2025
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.
react-native-animateable-text
Advanced tools
A fork of React Native's <Text/> component that supports Animated Values
A fork of React Native's <Text/>
component that supports Animated Values as text!
yarn add react-native-animateable-text
npx pod-install
Use it the same as a <Text/>
component, except instead of passing the text as a child node, pass it using the text
props.
import AnimateableText from 'react-native-animateable-text';
const Example: React.FC = () => {
const text = useSharedValue('World');
const animatedText = useDerivedValue(() => `Hello ${text.value}`);
const animatedProps = useAnimatedProps(() => {
return {
text: animatedText.value,
};
});
return (
<AnimateableText
animatedProps={animatedProps}
// same other props as Text component
/>;
};
import AnimateableText from 'react-native-animateable-text';
const Example: React.FC = () => {
const text = useMemo(() => new Animated.Value('World'), []);
const animatedText = useMemo(() => concat('Hello', text));
return (
<AnimateableText
text={animatedText}
// same other props as Text component
/>;
};
We want to animate numbers based on gestures as fast as possible, for example for charts displaying financial data. Updating native state is too slow and not feasible for a smooth experience. Using createAnimatedComponent
doesn't allow you to animate the text since the children of Text are separate nodes rather than just props.
The best way so far has been to use the <ReText>
component from react-native-redash, which allows you to render a string from a Reanimated Text node. However, under the hood, it uses a <TextInput/>
and animates it's value
prop.
This naturally comes with a few edge cases, for example:
TextInput
, you need to add more styles to make it align with the rest of your text. (Behavior in screenshot happens only on Android)
selectable
, dataDetectorType
or onTextLayout
.
See the contributing guide to learn how to contribute to the repository and the development workflow.
Written by Jonny Burger for our needs at Axelra.
Thanks to Axelra for sponsoring my time to turn this into an open source project!
MIT
FAQs
A fork of React Native's `<Text/> component that supports Reanimated Shared Values as text!
The npm package react-native-animateable-text receives a total of 5,821 weekly downloads. As such, react-native-animateable-text popularity was classified as popular.
We found that react-native-animateable-text demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.
Security News
Biome's v2.0 beta introduces custom plugins, domain-specific linting, and type-aware rules while laying groundwork for HTML support and embedded language features in 2025.
Security News
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.