{"id":13676470,"url":"https://github.com/axelra-ag/react-native-animateable-text","last_synced_at":"2025-05-14T20:04:13.709Z","repository":{"id":37436537,"uuid":"295225058","full_name":"axelra-ag/react-native-animateable-text","owner":"axelra-ag","description":"🆎  A fork of React Native's \u003cText/\u003e component that supports Reanimated Shared Values as text!","archived":false,"fork":false,"pushed_at":"2025-02-20T10:26:17.000Z","size":3979,"stargazers_count":406,"open_issues_count":1,"forks_count":30,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T09:05:24.553Z","etag":null,"topics":["react-native","reanimated","reanimated2","text"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-native-animateable-text","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axelra-ag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-13T19:44:23.000Z","updated_at":"2025-04-05T10:47:13.000Z","dependencies_parsed_at":"2024-01-14T14:31:20.123Z","dependency_job_id":"7e540622-eeb9-4636-9205-b6aa6b5ea2ce","html_url":"https://github.com/axelra-ag/react-native-animateable-text","commit_stats":{"total_commits":93,"total_committers":7,"mean_commits":"13.285714285714286","dds":"0.11827956989247312","last_synced_commit":"070e2984f972080af9b63348d779d9682902d7d2"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelra-ag%2Freact-native-animateable-text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelra-ag%2Freact-native-animateable-text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelra-ag%2Freact-native-animateable-text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelra-ag%2Freact-native-animateable-text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axelra-ag","download_url":"https://codeload.github.com/axelra-ag/react-native-animateable-text/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717242,"owners_count":21150388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react-native","reanimated","reanimated2","text"],"created_at":"2024-08-02T13:00:27.884Z","updated_at":"2025-05-14T20:04:13.644Z","avatar_url":"https://github.com/axelra-ag.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# react-native-animateable-text\n\nA fork of React Native's `\u003cText/\u003e` component that supports Reanimated Shared Values as text!\n\n## Compatibility \n(🚨 Make sure you use the correct version for your RN project)\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eAnimateable Text Version\u003c/th\u003e\n    \u003cth\u003eRN Version\u003c/th\u003e\n    \u003cth\u003eOld Arch\u003c/th\u003e\n    \u003cth\u003eNew Arch (Fabric)\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e ^0.16.0-beta.0\u003c/td\u003e\n    \u003ctd\u003e ^0.79.0\u003c/td\u003e\n    \u003ctd\u003e✅\u003c/td\u003e\n    \u003ctd\u003e✅\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e ^0.15.0\u003c/td\u003e\n    \u003ctd\u003e ^0.77.0\u003c/td\u003e\n    \u003ctd\u003e✅\u003c/td\u003e\n    \u003ctd\u003e✅\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e ^0.14.2\u003c/td\u003e\n    \u003ctd\u003e ^0.76.0\u003c/td\u003e\n    \u003ctd\u003e✅\u003c/td\u003e\n    \u003ctd\u003e✅\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e ^0.13.0\u003c/td\u003e\n    \u003ctd\u003e ^0.75.0\u003c/td\u003e\n    \u003ctd\u003e✅\u003c/td\u003e\n    \u003ctd\u003e🛑\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e ^0.12.0\u003c/td\u003e\n    \u003ctd\u003e ^0.74.0\u003c/td\u003e\n    \u003ctd\u003e✅\u003c/td\u003e\n    \u003ctd\u003e🛑\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e ^0.11.0\u003c/td\u003e\n    \u003ctd\u003e ^0.71.7\u003c/td\u003e\n    \u003ctd\u003e✅\u003c/td\u003e\n    \u003ctd\u003e🛑\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e ^0.10.0\u003c/td\u003e\n    \u003ctd\u003e ^0.68\u003c/td\u003e\n    \u003ctd\u003e✅\u003c/td\u003e\n    \u003ctd\u003e🛑\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e ^0.9.1\u003c/td\u003e\n    \u003ctd\u003e ^0.67\u003c/td\u003e\n    \u003ctd\u003e✅\u003c/td\u003e\n    \u003ctd\u003e🛑\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e ^0.8.0\u003c/td\u003e\n    \u003ctd\u003e ^0.66\u003c/td\u003e\n    \u003ctd\u003e✅\u003c/td\u003e\n    \u003ctd\u003e🛑\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e ^0.7.0\u003c/td\u003e\n    \u003ctd\u003e ^0.65\u003c/td\u003e\n    \u003ctd\u003e✅\u003c/td\u003e\n    \u003ctd\u003e🛑\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e ^0.6.0\u003c/td\u003e\n    \u003ctd\u003e ^0.64\u003c/td\u003e\n    \u003ctd\u003e✅\u003c/td\u003e\n    \u003ctd\u003e🛑\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e ^0.5.9\u003c/td\u003e\n    \u003ctd\u003e ^0.63\u003c/td\u003e\n    \u003ctd\u003e✅\u003c/td\u003e\n    \u003ctd\u003e🛑\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Installation\n\nFirst make sure you have reanimated already installed and linked from [here](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/) then run\n```sh\nyarn add react-native-animateable-text\n```\n\nthen for *Expo* managed projects you need to prebuild your project, and for *ReactNative* bare projects you should run\n```sh\nnpx pod-install\n```\n\n\n\n## Usage (Reanimated 2/3)\n\n\u003e Note about Reanimated 2: The library does not work with Alpha 9 until RC1. Make sure to update to RC2 or later!\n\nUse it the same as a `\u003cText/\u003e` component, except instead of passing the text as a child node, pass it using the `text` props.\n\n```tsx\nimport AnimateableText from 'react-native-animateable-text';\n\nconst Example: React.FC = () =\u003e {\n  const reanimatedText = useSharedValue('World');\n\n  const animatedProps = useAnimatedProps(() =\u003e {\n    return {\n      text: reanimatedText.value,\n    };\n  });\n\n  return (\n    \u003cAnimateableText\n      animatedProps={animatedProps}\n      // all other \u003cText /\u003e props are also available\n    /\u003e;\n};\n```\n\n\n## [OMG, why would you build this?](https://www.npmjs.com/package/react-native-reanimated/v/1.4.0#omg-why-would-you-build-this-motivation)\n\nWe 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.\n\nThe best way so far has been to use the `\u003cReText\u003e` component from [react-native-redash](https://wcandillon.github.io/react-native-redash-v1-docs/strings#retext), which allows you to render a string from a Reanimated Text node. However, under the hood, it uses a `\u003cTextInput/\u003e` and animates it's `value` prop.\n\nThis naturally comes with a few edge cases, for example:\n\n\u003cul\u003e\n\n\u003cli\u003e\n*Flicker*: When changing values too fast, the text can be cut off and show an ellipsis. The problem gets worse the slower the device and the more congested the render queue is. Watch this GIF at 0.2x speed carefully: \u003cbr/\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/1629785/99287990-458d4600-283b-11eb-8d5e-0c1129189c89.gif\"/\u003e\n\n\u003c/li\u003e\n\u003cli\u003e\n*Inconsistent styling*: When styling a \u003ccode\u003eTextInput\u003c/code\u003e, you need to add more styles and spacing to make it align with the default \u003ccode\u003eText\u003c/code\u003e styles. (Behavior in screenshot happens only on Android)\n\u003c/li\u003e \u003cimg src=\"https://user-images.githubusercontent.com/1629785/99298147-8c823800-2849-11eb-9939-e326dd8d9f25.png\" width=\"388\"/\u003e \u003cbr/\u003e\n\n\u003cli\u003e\n*Lack of full capabilities*: Not all props are available. With Animateable Text, you can use props that you cannot use on a TextInput, such as \u003ccode\u003eselectable\u003c/code\u003e (Android), \u003ccode\u003edataDetectorType\u003c/code\u003e or \u003ccode\u003eonTextLayout\u003c/code\u003e.\n\u003cbr/\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/1629785/99299532-a15fcb00-284b-11eb-83d2-d3601825a80a.png\" width=\"388\"\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## Credits\n\nWritten by [Jonny Burger](https://jonny.io) for our needs at [Axelra](https://axelra.com).\n\nThanks to Axelra for sponsoring my time to turn this into an open source project!\n\n\u003cbr/\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/1629785/99300604-1ed80b00-284d-11eb-9887-9fb0832ef8de.png\" width=\"150\"\u003e \u003cbr\u003e\n\u003csub\u003eWe are a Swiss Agency specializing in React Native, caring even about the smallest of details.\u003c/sub\u003e\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxelra-ag%2Freact-native-animateable-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxelra-ag%2Freact-native-animateable-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxelra-ag%2Freact-native-animateable-text/lists"}