{"id":13725747,"url":"https://github.com/adrianmcli/react-rotating-text","last_synced_at":"2025-05-07T17:51:10.443Z","repository":{"id":41150384,"uuid":"54255840","full_name":"adrianmcli/react-rotating-text","owner":"adrianmcli","description":"📝 A simple react component to display an array of words/sentences with a typewriter effect.","archived":false,"fork":false,"pushed_at":"2023-04-19T14:50:20.000Z","size":1463,"stargazers_count":224,"open_issues_count":18,"forks_count":33,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T12:39:07.546Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://adrianmcli.github.io/react-rotating-text/","language":"JavaScript","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/adrianmcli.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}},"created_at":"2016-03-19T08:33:10.000Z","updated_at":"2025-03-20T18:15:48.000Z","dependencies_parsed_at":"2023-10-20T16:21:43.657Z","dependency_job_id":null,"html_url":"https://github.com/adrianmcli/react-rotating-text","commit_stats":null,"previous_names":["adrianmc/react-rotating-text"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmcli%2Freact-rotating-text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmcli%2Freact-rotating-text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmcli%2Freact-rotating-text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmcli%2Freact-rotating-text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrianmcli","download_url":"https://codeload.github.com/adrianmcli/react-rotating-text/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252793542,"owners_count":21805053,"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":[],"created_at":"2024-08-03T01:02:33.428Z","updated_at":"2025-05-07T17:51:10.417Z","avatar_url":"https://github.com/adrianmcli.png","language":"JavaScript","readme":"# react-rotating-text\n\n![effect showcase](http://i.imgur.com/AC5g7KD.gif)\n\nA simple component to create a typewriter effect where strings are typed out and then deleted. Simply pass in an array of strings and the component will rotate through all of them.\n\n\n## Demo \u0026 Examples\n\nLive demo: [adrianmcli.github.io/react-rotating-text](http://adrianmcli.github.io/react-rotating-text/)\n\nTo build the examples locally, run:\n\n```\nnpm install\nnpm start\n```\n\nThen open [`localhost:8000`](http://localhost:8000) in a browser.\n\n\n## Installation\n\nThe easiest way to use react-rotating-text is to install it from NPM and include it in your own React build process (using [Browserify](http://browserify.org), [Webpack](http://webpack.github.io/), [Brunch](http://brunch.io/), etc).\n\nYou can also use the standalone build by including `dist/react-rotating-text.js` in your page. If you use this, make sure you have already included React, and it is available as a global variable.\n\n```\nnpm install react-rotating-text --save\n```\n\n\n## Usage\n\nSimply require the component and then pass in an array of strings into the `items` prop:\n\n```jsx\nvar ReactRotatingText = require('react-rotating-text');\n\n\u003cReactRotatingText items={['first', 'second', 'third']} /\u003e\n```\n\nIn order to have a blinking cursor, you'll need to apply some CSS to the `react-rotating-text-cursor` class:\n\n```css\n.react-rotating-text-cursor {\n  animation: blinking-cursor 0.8s cubic-bezier(0.68, 0.01, 0.01, 0.99) 0s infinite;\n}\n\n@keyframes blinking-cursor {\n  0% {\n    opacity: 0;\n  }\n  50% {\n    opacity: 1;\n  }\n  100% {\n    opacity: 0;\n  }\n}\n```\n\nDon't forget to put in vendor prefixes should you need them. A full example is available in `example/dist/ReactRotatingText.css`.\n\n### Properties\n\n**items (*array*)**  \n*(default: ['first', 'second', 'third'])*  \nThe array of strings to be cycled through.\n\n**color (*string*)**  \n*(default: 'inherit')*  \nThis specifies the color of the text.\n\n**cursor (*boolean*)**  \n*(default: true)*  \nIf set to true, it will display the cursor after the text.\n\n**pause (*integer*)**  \n*(default: 1500)*  \nThe number of milliseconds to pause after the text has just finished being typed out.\n\n**emptyPause (*integer*)**  \n*(default: 1000)*  \nThe number of milliseconds to pause while no text is being displayed (i.e. after deleting has just finished).\n\n**eraseMode (*string*)**  \n*(default: 'erase')*\nThis specifies the erasing mode. May be set to \"erase\" or \"overwrite\".\n\n**typingInterval (*integer*)**  \n*(default: 50)*  \nThe number of milliseconds between each typing action.\n\n**deletingInterval (*integer*)**  \n*(default: 50)*  \nThe number of milliseconds between each deleting action.\n\n### Events\n\n#### onTypingStart\nA callback function to call when typing starts for current item.\n\n#### onTypingEnd\nA callback function to call when typing ends for current item.\n\n#### onDeletingStart\nA callback function to call when deleting starts for current item.\n\n#### onDeletingEnd\nA callback function to call when deleting finishes for current item.\n\nExample:\n```\n\u003cReactRotatingText items={[`events`,`are`,`fun`]} onTypingStart={() =\u003e console.log(`Typing Started`)} /\u003e\n```\n\n### Notes\n\nEnhancements and pull requests are welcomed.\n\n\n## Development (`src`, `lib` and the build process)\n\n**NOTE:** The source code for the component is in `src`. A transpiled CommonJS version (generated with Babel) is available in `lib` for use with node.js, browserify and webpack. A UMD bundle is also built to `dist`, which can be included without the need for any build system.\n\nTo build, watch and serve the examples (which will also watch the component source), run `npm start`. If you just want to watch changes to `src` and rebuild `lib`, run `npm run watch` (this is useful if you are working with `npm link`).\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Adrian Li.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianmcli%2Freact-rotating-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrianmcli%2Freact-rotating-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianmcli%2Freact-rotating-text/lists"}