{"id":18265556,"url":"https://github.com/wintercore/react-text-transition","last_synced_at":"2025-05-15T18:05:31.036Z","repository":{"id":38984862,"uuid":"130556543","full_name":"WinterCore/react-text-transition","owner":"WinterCore","description":"Animate your text changes","archived":false,"fork":false,"pushed_at":"2023-11-29T11:44:16.000Z","size":1259,"stargazers_count":626,"open_issues_count":19,"forks_count":25,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-31T21:51:20.664Z","etag":null,"topics":["animate","react","text","transition"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/WinterCore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2018-04-22T10:18:45.000Z","updated_at":"2025-03-21T03:16:40.000Z","dependencies_parsed_at":"2024-06-18T13:37:37.821Z","dependency_job_id":"e3590bba-cccd-4460-9f4b-322ad502a85d","html_url":"https://github.com/WinterCore/react-text-transition","commit_stats":{"total_commits":73,"total_committers":4,"mean_commits":18.25,"dds":0.06849315068493156,"last_synced_commit":"618043ed5ddd9c8baf9a91f6f83138a67b463c75"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WinterCore%2Freact-text-transition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WinterCore%2Freact-text-transition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WinterCore%2Freact-text-transition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WinterCore%2Freact-text-transition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WinterCore","download_url":"https://codeload.github.com/WinterCore/react-text-transition/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247737788,"owners_count":20987721,"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":["animate","react","text","transition"],"created_at":"2024-11-05T11:18:48.378Z","updated_at":"2025-04-07T22:11:20.774Z","avatar_url":"https://github.com/WinterCore.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React-Text-transition\n\n### Animate your text changes\n\n![text-transition](https://raw.githubusercontent.com/WinterCore/react-text-transition/master/example-gifs/example.gif)\n\n[![Edit r03264p26n](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-text-transition-ts-6wp1s7?file=/src/components/App.tsx)\n\n## Installation\n\n`npm install -S react-text-transition`\n\n## Using the demo\n\n`npm run dev`\n\n## How to use\n\n### Example\n\n```javascript\nimport React from 'react';\nimport TextTransition, { presets } from 'react-text-transition';\n\nconst TEXTS = ['Forest', 'Building', 'Tree', 'Color'];\n\nconst App = () =\u003e {\n  const [index, setIndex] = React.useState(0);\n\n  React.useEffect(() =\u003e {\n    const intervalId = setInterval(\n      () =\u003e setIndex((index) =\u003e index + 1),\n      3000, // every 3 seconds\n    );\n    return () =\u003e clearTimeout(intervalId);\n  }, []);\n\n  return (\n    \u003ch1\u003e\n      \u003cTextTransition springConfig={presets.wobbly}\u003e{TEXTS[index % TEXTS.length]}\u003c/TextTransition\u003e\n    \u003c/h1\u003e\n  );\n};\n```\n\n### Props\n\n| Prop         | Type                | Default                                 | Definition                                                                                              |\n| ------------ | ------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------- |\n| direction    | String (enum)       | 0                                       | Used to determine the direction of the transition `\"up\"` or `\"down\"` (Must be an all-lowercase string). |\n| inline       | Boolean             | false                                   | Makes the wrapper inline (will auto resize based on contents).                                          |\n| delay        | Number              | 0                                       | Delay the transition of the text (in milliseconds).                                                     |\n| springConfig | Object              | { mass: 1, tension: 170, friction: 26 } | react-spring's spring configuration.                                                                    |\n| className    | String              | \"\"                                      | Any css classes that you might want to send to the wrapper.                                             |\n| style        | React.CSSProperties | {}                                      | Any styles that you might want to send to the wrapper.                                                  |\n| children     | React.ReactNode     | REQUIRED                                | The react node to be animated                                                                           |\n| translateValue     | string     | \"100%\"                                | Transform value for determine height animation                                                                           |\n\n---\n\n### Detailed Props\n\n#### inline `Boolean`\n\nWill simply make the wrapper an inline element and animate its width based on currently showing\ntext, this is useful if you want to show some other static text on the same line.\n\n#### delay `Number`\n\nThe amount of miliseconds to wait before transitioning.\n\n#### spring `Object`\n\nreact-spring's [Spring configuration](https://www.react-spring.io/docs/hooks/api) (Refer to the\nconfigs section) react-spring's spring presets are exposed as `presets`.\n\n```javascript\nimport TextTransition, { presets } from 'react-text-transition';\n\n// in your render method\n\u003cTextTransition springConfig={presets.wobbly}\u003e{this.state.text}\u003c/TextTransition\u003e;\n```\n\nYou have the following presets\n\n- `default` The default.\n- `gentle`\n- `wobbly`\n- `stiff`\n- `slow`\n- `molasses`\n\n#### className `String`\n\nAny css classes that you might want to provide to the wrapper.\n\n#### style `React.CSSProperties`\n\nAny css styles that you might want to provide to the wrapper.\n\n## NOTE\n\nFeel free to ask any questions about using this component. This plugin requires\n[react](https://www.npmjs.com/package/react) +16.8\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwintercore%2Freact-text-transition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwintercore%2Freact-text-transition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwintercore%2Freact-text-transition/lists"}