{"id":20405616,"url":"https://github.com/nitrictech/react-animated-term","last_synced_at":"2025-04-12T15:05:40.689Z","repository":{"id":43827778,"uuid":"459351911","full_name":"nitrictech/react-animated-term","owner":"nitrictech","description":"React component for rendering animated terminals","archived":false,"fork":false,"pushed_at":"2023-10-03T03:14:50.000Z","size":924,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-04-12T15:03:59.979Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://react-animated-term.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nitrictech.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":"2022-02-14T22:53:25.000Z","updated_at":"2025-04-10T02:36:29.000Z","dependencies_parsed_at":"2023-10-03T05:00:34.520Z","dependency_job_id":"5d02f378-ceca-45d0-827c-40a1c2f7172f","html_url":"https://github.com/nitrictech/react-animated-term","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"58c0f8b944d881048d39f53145c306c6012be719"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitrictech%2Freact-animated-term","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitrictech%2Freact-animated-term/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitrictech%2Freact-animated-term/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitrictech%2Freact-animated-term/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nitrictech","download_url":"https://codeload.github.com/nitrictech/react-animated-term/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586239,"owners_count":21128997,"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-11-15T05:12:10.237Z","updated_at":"2025-04-12T15:05:40.665Z","avatar_url":"https://github.com/nitrictech.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @nitric/react-animated-term\n\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/nitrictech/react-animated-term/Tests?label=tests)\n![Codecov](https://img.shields.io/codecov/c/github/nitrictech/react-animated-term)\n![npm (scoped)](https://img.shields.io/npm/v/@nitric/react-animated-term)\n![npm](https://img.shields.io/npm/dw/@nitric/react-animated-term)\n\n\u003e Animated terminal component for [React](https://reactjs.org/)\n\u003e\n\u003e Rewrite of [react-animated-term](https://github.com/dongy7/react-animated-term) in Typescript with added features\n\n\u003cp align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003cimg width=\"400\" src=\"media/demo-basic.gif\"\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\n## Installation\n\n```\nnpm install @nitric/react-animated-term\n```\n\nOR\n\n```bash\nyarn add @nitric/react-animated-term\n```\n\nYou can then import `react-animated-term` and its styles.\n\n```js\nimport Terminal from '@nitric/react-animated-term';\nimport '@nitric/react-animated-term/css/styles.css';\n```\n\n## Usage\n\nThe terminal commands and output lines are specified as an array of objects. The `text` field specifies the content of the line and `cmd` is used to specify whether the line is a command or an output. The `interval` prop specifies how often the terminal should be updated.\n\n```js\nimport React from 'react';\nimport Terminal from '@nitric/react-animated-term';\n\nconst termLines = [\n  {\n    text: 'ls',\n    color: 'blue', // you can add colors\n    cmd: true,\n  },\n  {\n    text: 'index.js    package.json    node_modules',\n    cmd: false,\n  },\n  {\n    text: '',\n    cmd: true,\n  },\n];\n\nconst MyComponent = () =\u003e {\n  return \u003cTerminal lines={termLines} interval={80} /\u003e;\n};\n```\n\n### Framed Animation\n\n\u003cp align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003cimg width=\"400\" src=\"media/demo-spinner.gif\"\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\nYou can also render output that consists of frames by specifying the individual frames. With a framed output, the `text` field specifies the final output that should be rendered after all the frames have been rendered. Delays can also be specified for individual frames and commands.\n\n```jsx\nimport React from 'react';\nimport Terminal from '@nitric/react-animated-term';\nconst spinner = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];\nconst termLines = [\n  {\n    text: 'node example.js',\n    cmd: true,\n    delay: 80,\n  },\n  {\n    text: '✔ Loaded app',\n    element: \u003c\u003e\u003cspan className=\"text-green\"\u003e✔\u003c/span\u003e Loaded app\u003c\u003e,\n    cmd: false,\n    repeat: true,\n    repeatCount: 5,\n    frames: spinner.map(function (spinner) {\n      return {\n        text: spinner + ' Loading app',\n        delay: 40,\n      };\n    }),\n  },\n  {\n    text: '',\n    cmd: true,\n  },\n];\n\nconst MyComponent = () =\u003e {\n  return \u003cTerminal lines={termLines} interval={80} /\u003e;\n};\n```\n\n### Themes\n\nA white themed terminal is specified using the `white` prop.\n\n\u003cp align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003cimg width=\"400\" src=\"media/white-terminal.png\"\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\n```js\nimport React from 'react';\nimport Terminal from '@nitric/react-animated-term';\n\nconst MyComponent = () =\u003e {\n  return \u003cTerminal lines={termLines} interval={80} white /\u003e;\n};\n```\n\n### Props\n\n| Property    | Type    | Default   | Description                                                                    |\n| :---------- | :------ | :-------- | :----------------------------------------------------------------------------- |\n| lines       | array   | undefined | array of terminal lines                                                        |\n| interval    | number  | 100       | interval at which terminal output is updated in milliseconds                   |\n| white       | boolean | false     | whether to render a white themed terminal                                      |\n| height      | number  | 240       | the height of the terminal                                                     |\n| onCompleted | func    | undefined | a function callback that gets called when the terminal animation has completed |\n| replay      | boolean | true      | Shows or hides the replay button                                               |\n\n### Examples\n\nYou can view the deployed example from `examples/create-react-app` here: [react-animated-term.vercel.app](https://react-animated-term.vercel.app).\n\nTo run the examples, clone and install the dependencies:\n\n```bash\ngit clone https://github.com/nitrictech/react-animated-term.git\nyarn install\n```\n\nThen, run the `start` script and open up `http://localhost:3000`.\n\n```bash\nyarn start\n```\n\n## Credits\n\nThe original code was written by [dongy7](https://github.com/dongy7) under the [react-animated-term](https://github.com/dongy7/react-animated-term) repo.\n\nThe styling for the terminal was adapted from the [Hyper](https://hyper.is/) terminal.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitrictech%2Freact-animated-term","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnitrictech%2Freact-animated-term","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitrictech%2Freact-animated-term/lists"}