{"_id":"opentui-spinner","_rev":"7-cffa0394335b1e3dccd8517a38cf9a65","name":"opentui-spinner","dist-tags":{"latest":"0.0.7"},"versions":{"0.0.1":{"name":"opentui-spinner","version":"0.0.1","keywords":[],"_id":"opentui-spinner@0.0.1","maintainers":[{"name":"msmps","email":"hello@msmp.me"}],"dist":{"shasum":"28b0a027484b099ab592bdcb37f75e99ed8c407d","tarball":"https://registry.npmjs.org/opentui-spinner/-/opentui-spinner-0.0.1.tgz","fileCount":1,"integrity":"sha512-KLaO9EsCeYLOpdXWxBbHdudK2FT639C5xsTAIQ4Nis+LkwS0/w2erUFp97wfLK4JrLFEjOmp6cgGJ1gzrz/8MA==","signatures":[{"sig":"MEUCIQDm0W53QCr9uXay7oqAKwGSyfsbNxnYFZFogl+CFFrBXgIgEgJdokLjV6wqF5x2uZWjPg5sgnbm8aynmCGcmSSNZeo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":170},"type":"module","scripts":{"text":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"msmps","email":"hello@msmp.me"},"_npmVersion":"10.9.2","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/opentui-spinner_0.0.1_1756137571514_0.12641552075277795","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"opentui-spinner","version":"0.0.2","keywords":["opentui","spinner","cli","terminal","console","tui"],"author":{"name":"Matt Simpson"},"license":"MIT","_id":"opentui-spinner@0.0.2","maintainers":[{"name":"msmps","email":"hello@msmp.me"}],"homepage":"https://github.com/msmps/opentui-spinner#readme","bugs":{"url":"https://github.com/msmps/opentui-spinner/issues"},"dist":{"shasum":"f96b9867c63353063dab48197c40314b0ab7f937","tarball":"https://registry.npmjs.org/opentui-spinner/-/opentui-spinner-0.0.2.tgz","fileCount":7,"integrity":"sha512-2QCWHRDNu8t0dV6X5mm7382MFaoL39c8luIxvb9M+c1lL2aSuPKaAlQcLrL9fYr8uEfBDR19ke0BjgPfkW+SFw==","signatures":[{"sig":"MEQCIFgQd2M/I+Adqd0fMNOLjMwNC/TPsoi1OPt1txNcebl3AiAPaLgf3lae+VutVFKOP84G1Kv9KzJDSWlawn3k+1XsnA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5762},"type":"module","types":"dist/index.d.mts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"./react":{"import":{"types":"./dist/react.d.mts","default":"./dist/react.mjs"}}},"gitHead":"ec4ff083c75a5047d2d22a3e9e87869713a043e2","scripts":{"lint":"biome check .","build":"tsdown","lint:fix":"biome check . --write"},"_npmUser":{"name":"msmps","email":"hello@msmp.me"},"repository":{"url":"git+https://github.com/msmps/opentui-spinner.git","type":"git"},"_npmVersion":"10.9.2","description":"A small & opinionated spinner library","directories":{},"_nodeVersion":"22.14.0","dependencies":{"cli-spinners":"^3.3.0"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.16.0","@types/bun":"latest","@biomejs/biome":"2.3.4"},"peerDependencies":{"react":"^19.1.1","typescript":"^5","@opentui/core":"^0.1.39","@opentui/react":"^0.1.39"},"peerDependenciesMeta":{"react":{"optional":true},"@opentui/react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/opentui-spinner_0.0.2_1762645544716_0.8644869727672351","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"opentui-spinner","version":"0.0.3","keywords":["opentui","spinner","cli","terminal","console","tui"],"author":{"name":"Matt Simpson"},"license":"MIT","_id":"opentui-spinner@0.0.3","maintainers":[{"name":"msmps","email":"hello@msmp.me"}],"homepage":"https://github.com/msmps/opentui-spinner#readme","bugs":{"url":"https://github.com/msmps/opentui-spinner/issues"},"dist":{"shasum":"6813be79640ddfd1f42ecd6555b886659d61bda1","tarball":"https://registry.npmjs.org/opentui-spinner/-/opentui-spinner-0.0.3.tgz","fileCount":10,"integrity":"sha512-u9CcvE1i2AF103ArfBfGOs7b38UHRdsl8Q2daUvTnWqLa4+gGb5ap7T/DcscinkYTDSbrLQ5Hy/krykvVXueJw==","signatures":[{"sig":"MEUCIAjQQKYHxpljbqOa546RwApkZeiBq2cNOQAx/BCqI2OjAiEA5/gtEuLCsJ1p4qq4aiKnGsp0VycxYaEJtSmRJwF/ezs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13520},"type":"module","types":"dist/index.d.mts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"./react":{"import":{"types":"./dist/react.d.mts","default":"./dist/react.mjs"}},"./solid":{"import":{"types":"./dist/solid.d.mts","default":"./dist/solid.mjs"}}},"gitHead":"642d347b527fe7f2d2575b6e5f8d330727453ad7","scripts":{"lint":"biome check .","build":"tsdown","lint:fix":"biome check . --write"},"_npmUser":{"name":"msmps","email":"hello@msmp.me"},"repository":{"url":"git+https://github.com/msmps/opentui-spinner.git","type":"git"},"_npmVersion":"10.9.2","description":"A small & opinionated spinner library","directories":{},"_nodeVersion":"22.14.0","dependencies":{"cli-spinners":"^3.3.0"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.16.0","@types/bun":"latest","@biomejs/biome":"2.3.4"},"peerDependencies":{"typescript":"^5","@opentui/core":"^0.1.39","@opentui/react":"^0.1.39","@opentui/solid":"^0.1.39"},"peerDependenciesMeta":{"@opentui/react":{"optional":true},"@opentui/solid":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/opentui-spinner_0.0.3_1762714575783_0.19422555052482182","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"opentui-spinner","version":"0.0.4","keywords":["opentui","spinner","cli","terminal","console","tui"],"author":{"name":"Matt Simpson"},"license":"MIT","_id":"opentui-spinner@0.0.4","maintainers":[{"name":"msmps","email":"hello@msmp.me"}],"homepage":"https://github.com/msmps/opentui-spinner#readme","bugs":{"url":"https://github.com/msmps/opentui-spinner/issues"},"dist":{"shasum":"0786b46e8d7b390c8809413176c333637e3bd906","tarball":"https://registry.npmjs.org/opentui-spinner/-/opentui-spinner-0.0.4.tgz","fileCount":10,"integrity":"sha512-VGK1EkvNHwIT5sHOP3CMicauaxzw818MyOTaudfmEfPY5ZxRcIPq4D8kbNUXoOlOmbwTZwKUPKznpzYIjnJTMw==","signatures":[{"sig":"MEUCIFoGdRe4sB5HnSMi4uDlKrfz092POUmu6opwnYBqRCDXAiEA3Q5diEhrYMxzVBAU+vdSWymC3TE0k1p05JRQjC2ALPk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17054},"type":"module","types":"dist/index.d.mts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"./react":{"import":{"types":"./dist/react.d.mts","default":"./dist/react.mjs"}},"./solid":{"import":{"types":"./dist/solid.d.mts","default":"./dist/solid.mjs"}}},"gitHead":"e779abf27a8292ab4c85ef6b2db09851f2918b2b","scripts":{"lint":"biome check .","build":"tsdown","lint:fix":"biome check . --write"},"_npmUser":{"name":"msmps","email":"hello@msmp.me"},"repository":{"url":"git+https://github.com/msmps/opentui-spinner.git","type":"git"},"_npmVersion":"10.9.2","description":"A small & opinionated spinner library","directories":{},"_nodeVersion":"22.14.0","dependencies":{"cli-spinners":"^3.3.0"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.16.0","@types/bun":"latest","@biomejs/biome":"2.3.4"},"peerDependencies":{"typescript":"^5","@opentui/core":"^0.1.49","@opentui/react":"^0.1.49","@opentui/solid":"^0.1.49"},"peerDependenciesMeta":{"@opentui/react":{"optional":true},"@opentui/solid":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/opentui-spinner_0.0.4_1763933634195_0.3501139167943377","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"opentui-spinner","version":"0.0.5","keywords":["opentui","spinner","cli","terminal","console","tui"],"author":{"name":"Matt Simpson"},"license":"MIT","_id":"opentui-spinner@0.0.5","maintainers":[{"name":"msmps","email":"hello@msmp.me"}],"homepage":"https://github.com/msmps/opentui-spinner#readme","bugs":{"url":"https://github.com/msmps/opentui-spinner/issues"},"dist":{"shasum":"8a97d8dbd521156ac2c3244d5cce68bd11227846","tarball":"https://registry.npmjs.org/opentui-spinner/-/opentui-spinner-0.0.5.tgz","fileCount":10,"integrity":"sha512-abSWzWA7eyuD0PjerAWbBznLmOQn+8xRDaLGCVIs4ctETi2laNFr5KwicYnPXsHZpPc2neV7WtQm+diCEfOhLA==","signatures":[{"sig":"MEYCIQD6Tq/gWs/qQFEfeMgjzEPn4tpn0E25RcIgeDHqkQQwPwIhAIDB4B7Luq29UpqaeghjNBbJYyLZi5Z+HGAHdLBwKhft","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16502},"type":"module","types":"dist/index.d.mts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"./react":{"import":{"types":"./dist/react.d.mts","default":"./dist/react.mjs"}},"./solid":{"import":{"types":"./dist/solid.d.mts","default":"./dist/solid.mjs"}}},"gitHead":"5b5cf275b7d07104d0498d1eaa7fbfff292b3e2f","scripts":{"lint":"biome check .","build":"tsdown","lint:fix":"biome check . --write"},"_npmUser":{"name":"msmps","email":"hello@msmp.me"},"repository":{"url":"git+https://github.com/msmps/opentui-spinner.git","type":"git"},"_npmVersion":"10.9.2","description":"A small & opinionated spinner library","directories":{},"_nodeVersion":"22.14.0","dependencies":{"cli-spinners":"^3.3.0"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.16.0","@types/bun":"latest","@biomejs/biome":"2.3.4"},"peerDependencies":{"typescript":"^5","@opentui/core":"^0.1.49","@opentui/react":"^0.1.49","@opentui/solid":"^0.1.49"},"peerDependenciesMeta":{"@opentui/react":{"optional":true},"@opentui/solid":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/opentui-spinner_0.0.5_1763943041510_0.5142596838477489","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"opentui-spinner","version":"0.0.6","keywords":["opentui","spinner","cli","terminal","console","tui"],"author":{"name":"Matt Simpson"},"license":"MIT","_id":"opentui-spinner@0.0.6","maintainers":[{"name":"msmps","email":"hello@msmp.me"}],"homepage":"https://github.com/msmps/opentui-spinner#readme","bugs":{"url":"https://github.com/msmps/opentui-spinner/issues"},"dist":{"shasum":"a61a1fca537dadf609d470b9d3434331bf5b49d7","tarball":"https://registry.npmjs.org/opentui-spinner/-/opentui-spinner-0.0.6.tgz","fileCount":10,"integrity":"sha512-xupLOeVQEAXEvVJCvHkfX6fChDWmJIPHe5jyUrVb8+n4XVTX8mBNhitFfB9v2ZbkC1H2UwPab/ElePHoW37NcA==","signatures":[{"sig":"MEQCIHKaUEvoTE4Xs9FIdnuPRhg34hoEUlyI2S1GeawBn4HfAiB4eNYi9/9WFW2SWLYmS1IVmuIBSHGNhrqYRzK/mj4BvA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16504},"type":"module","types":"dist/index.d.mts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"./react":{"import":{"types":"./dist/react.d.mts","default":"./dist/react.mjs"}},"./solid":{"import":{"types":"./dist/solid.d.mts","default":"./dist/solid.mjs"}}},"gitHead":"95ca2e17f058eca99cb1beaf63f87445c3128cc0","scripts":{"lint":"biome check .","build":"tsdown","lint:fix":"biome check . --write"},"_npmUser":{"name":"msmps","email":"hello@msmp.me"},"repository":{"url":"git+https://github.com/msmps/opentui-spinner.git","type":"git"},"_npmVersion":"11.6.1","description":"A small & opinionated spinner library","directories":{},"_nodeVersion":"24.10.0","dependencies":{"cli-spinners":"^3.3.0"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.16.0","@types/bun":"latest","@biomejs/biome":"2.3.4"},"peerDependencies":{"typescript":"^5","@opentui/core":"^0.1.49","@opentui/react":"^0.1.49","@opentui/solid":"^0.1.49"},"peerDependenciesMeta":{"@opentui/react":{"optional":true},"@opentui/solid":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/opentui-spinner_0.0.6_1764020606968_0.9029065275688692","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"opentui-spinner","version":"0.0.7","sideEffects":["./dist/react.mjs","./dist/solid.mjs"],"description":"A small & opinionated spinner library","author":{"name":"Matt Simpson"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/msmps/opentui-spinner.git"},"type":"module","module":"dist/index.mjs","types":"dist/index.d.mts","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"./react":{"import":{"types":"./dist/react.d.mts","default":"./dist/react.mjs"}},"./solid":{"import":{"types":"./dist/solid.d.mts","default":"./dist/solid.mjs"}}},"keywords":["opentui","spinner","cli","terminal","console","tui"],"scripts":{"build":"tsdown","bench":"bun bench/scheduler-benchmark.ts","bench:quick":"bun bench/scheduler-benchmark.ts --rounds=3 --min-sample-ms=100 --warmup=200","examples":"bun examples/","examples:react":"bun examples/react.tsx","examples:solid":"bun --preload @opentui/solid/preload examples/solid.tsx","profile":"bun profile/spinner-cpu-profile.ts","lint":"biome check .","lint:fix":"biome check . --write","test":"bun run test:core && bun run test:react && bun run test:solid && bun run test:package","test:core":"bun test tests/core","test:react":"bun test tests/react","test:solid":"bun test --preload @opentui/solid/preload tests/solid","test:package":"bun run build && bun test tests/package","test:coverage":"bun test --coverage tests/core tests/react && bun test --coverage --preload @opentui/solid/preload tests/solid","typecheck":"tsc --noEmit && tsc --noEmit -p tests/solid/tsconfig.json && tsc --noEmit -p examples/tsconfig.json && tsc --noEmit -p examples/tsconfig.solid.json"},"devDependencies":{"@biomejs/biome":"2.3.4","@opentui/core":"^0.3.4","@opentui/react":"^0.3.4","@opentui/solid":"^0.3.4","@types/bun":"latest","@types/react":"^19.2.0","react":"^19.2.0","solid-js":"1.9.12","tsdown":"^0.16.0"},"peerDependencies":{"@opentui/core":"^0.3.4","@opentui/react":"^0.3.4","@opentui/solid":"^0.3.4","typescript":"^5"},"peerDependenciesMeta":{"@opentui/react":{"optional":true},"@opentui/solid":{"optional":true}},"dependencies":{"cli-spinners":"^3.3.0"},"gitHead":"7cd88909048a6ca435d468e77ae12ec0e21fa88c","_id":"opentui-spinner@0.0.7","bugs":{"url":"https://github.com/msmps/opentui-spinner/issues"},"homepage":"https://github.com/msmps/opentui-spinner#readme","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-nPzwAvJG+y9rVEwwHLHqbsMzLnIk2zw+F9LqwA7aYJvpM5gsrKC2rrGi36A+tZpA+1RnWxXeWEgVZMchnaH18Q==","shasum":"eef439cf0cdd7809fbde0017ddea9f123c297d46","tarball":"https://registry.npmjs.org/opentui-spinner/-/opentui-spinner-0.0.7.tgz","fileCount":10,"unpackedSize":24604,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICwAsfg32Hu1Db17SnPv0pQHePckbJNlRVD6bcsWjT43AiBOv9BtO/qS2xKj/XbQJGI/aIckWo+CltqjMPyi4Y1PUA=="}]},"_npmUser":{"name":"msmps","email":"hello@msmp.me"},"directories":{},"maintainers":[{"name":"msmps","email":"hello@msmp.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/opentui-spinner_0.0.7_1781022560757_0.9240677404442426"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-25T15:59:31.514Z","modified":"2026-06-09T16:29:21.034Z","0.0.1":"2025-08-25T15:59:31.689Z","0.0.2":"2025-11-08T23:45:44.910Z","0.0.3":"2025-11-09T18:56:15.963Z","0.0.4":"2025-11-23T21:33:54.369Z","0.0.5":"2025-11-24T00:10:41.727Z","0.0.6":"2025-11-24T21:43:27.171Z","0.0.7":"2026-06-09T16:29:20.940Z"},"bugs":{"url":"https://github.com/msmps/opentui-spinner/issues"},"author":{"name":"Matt Simpson"},"license":"MIT","homepage":"https://github.com/msmps/opentui-spinner#readme","keywords":["opentui","spinner","cli","terminal","console","tui"],"repository":{"type":"git","url":"git+https://github.com/msmps/opentui-spinner.git"},"description":"A small & opinionated spinner library","maintainers":[{"name":"msmps","email":"hello@msmp.me"}],"readme":"# opentui-spinner\n\n<div align=\"center\">\n    <a href=\"https://www.npmjs.com/package/opentui-spinner\"><img alt=\"npm\" src=\"https://img.shields.io/npm/v/opentui-spinner?style=flat-square\" /></a>\n    <a href=\"https://github.com/msmps/awesome-opentui\"><img alt=\"awesome opentui list\" src=\"https://awesome.re/mentioned-badge-flat.svg\" /></a>\n</div>\n\nA small & opinionated spinner library for terminal UIs built on [OpenTUI](https://github.com/sst/opentui).\n\n## Features\n\n- **Built-in Spinners** - Powered by [cli-spinners](https://github.com/sindresorhus/cli-spinners)\n- **Custom Spinners** - Create your own with custom frames and intervals\n- **React Support** - First-class React integration via OpenTUI React\n- **SolidJS Support** - First-class SolidJS integration via OpenTUI Solid\n- **Type-Safe** - Full TypeScript support\n\n## Installation\n\n```bash\nbun add opentui-spinner @opentui/core\n```\n\nFor React support:\n\n```bash\nbun add opentui-spinner @opentui/core @opentui/react react\n```\n\nFor SolidJS support:\n\n```bash\nbun add opentui-spinner @opentui/core @opentui/solid solid-js\n```\n\n## Usage\n\n### Interactive Examples\n\nEach launcher includes a chooser, every built-in spinner, custom animations,\nand shared console/debug controls:\n\n```bash\nbun run examples\nbun run examples:react\nbun run examples:solid\n```\n\nUse `Escape` to return to the chooser, backtick to toggle the console, `.` to\ntoggle the debug overlay, `Ctrl+G` to dump the hit grid, and `Ctrl+C` to exit.\n\n### Basic Usage (Core)\n\n```typescript\nimport { createCliRenderer } from \"@opentui/core\";\nimport { SpinnerRenderable } from \"opentui-spinner\";\n\nconst renderer = await createCliRenderer();\n\nconst spinner = new SpinnerRenderable(renderer, {\n  name: \"dots\",\n  color: \"cyan\",\n});\n\nrenderer.root.add(spinner);\n```\n\n### With Text Label\n\n```typescript\nimport {\n  BoxRenderable,\n  createCliRenderer,\n  TextRenderable,\n} from \"@opentui/core\";\nimport { SpinnerRenderable } from \"opentui-spinner\";\n\nconst renderer = await createCliRenderer();\n\nconst container = new BoxRenderable(renderer, {\n  border: true,\n  flexDirection: \"row\",\n  alignItems: \"center\",\n});\n\nconst spinner = new SpinnerRenderable(renderer, {\n  name: \"bouncingBall\",\n});\n\nconst label = new TextRenderable(renderer, {\n  content: \"Loading...\",\n  marginLeft: 1,\n});\n\ncontainer.add(spinner);\ncontainer.add(label);\nrenderer.root.add(container);\n```\n\n### React Usage\n\nFirst, import the React extension:\n\n```tsx\nimport \"opentui-spinner/react\";\n```\n\nThen use the `<spinner>` component in your OpenTUI React app:\n\n```tsx\nimport { createCliRenderer } from \"@opentui/core\";\nimport { createRoot } from \"@opentui/react\";\nimport \"opentui-spinner/react\";\n\nfunction App() {\n  return (\n    <box alignItems=\"center\" flexDirection=\"row\">\n      <spinner name=\"bouncingBall\" color=\"cyan\" />\n      <text marginLeft={1}>Loading...</text>\n    </box>\n  );\n}\n\nconst renderer = await createCliRenderer();\ncreateRoot(renderer).render(<App />);\n```\n\n### SolidJS Usage\n\nFirst, import the SolidJS extension:\n\n```tsx\nimport \"opentui-spinner/solid\";\n```\n\nThen use the `<spinner>` component in your OpenTUI SolidJS app:\n\n```tsx\nimport { render } from \"@opentui/solid\";\nimport \"opentui-spinner/solid\";\n\nfunction App() {\n  return (\n    <box alignItems=\"center\" flexDirection=\"row\">\n      <spinner name=\"bouncingBall\" color=\"cyan\" />\n      <text marginLeft={1}>Loading...</text>\n    </box>\n  );\n}\n\nrender(() => <App />);\n```\n\n## API Reference\n\n### SpinnerOptions\n\n| Option            | Type                           | Default         | Description                                  |\n| ----------------- | ------------------------------ | --------------- | -------------------------------------------- |\n| `name`            | `SpinnerName`                  | `\"dots\"`        | Name of a built-in spinner from cli-spinners |\n| `frames`          | `string[]`                     | -               | Custom animation frames (overrides `name`)   |\n| `interval`        | `number`                       | -               | Target frame interval from 16.67-1000ms       |\n| `autoplay`        | `boolean`                      | `true`          | Whether to start playing automatically       |\n| `color`           | `ColorInput \\| ColorGenerator` | `\"white\"`       | Foreground color or color generator function |\n| `backgroundColor` | `ColorInput`                   | `\"transparent\"` | Background color                             |\n\n### SpinnerRenderable Methods\n\n#### `start(): void`\n\nStart or resume the spinner animation.\n\n```typescript\nspinner.start();\n```\n\n#### `stop(): void`\n\nPause the spinner animation.\n\n```typescript\nspinner.stop();\n```\n\n### Properties\n\nAll options can be updated dynamically via properties:\n\n```typescript\n// Change spinner type\nspinner.name = \"line\";\n\n// Update color\nspinner.color = \"green\";\n\n// Or use a color generator\nspinner.color = createPulse([\"red\", \"yellow\", \"green\"]);\n\n// Update background color\nspinner.backgroundColor = \"blue\";\n\n// Change frames\nspinner.frames = [\"⠋\", \"⠙\", \"⠹\", \"⠸\", \"⠼\", \"⠴\", \"⠦\", \"⠧\", \"⠇\", \"⠏\"];\n\n// Adjust interval\nspinner.interval = 100;\n```\n\nIntervals must be finite numbers from `1000 / 60` through `1000`\nmilliseconds, inclusive. Invalid constructor values and property updates throw a\n`RangeError`. All running spinners share one adaptive scheduler interval,\nincluding across multiple OpenTUI renderers in the same process. Scheduler\nwake-ups are globally capped at 60 FPS, so staggered spinners can be delayed and\nrun below their configured rate. Invisible spinners are suspended until shown\nand do not advance frames or request renders while hidden.\n\n## Performance Benchmark\n\nRun the calibrated scheduler benchmark:\n\n```bash\nbun run bench -- --json=bench/results/latest.json\n```\n\nFor a faster local smoke run:\n\n```bash\nbun run bench:quick\n```\n\nThe benchmark compares the adaptive heap scheduler with its heap-only behavior,\nequivalent shared linear-scan workloads, and a per-spinner timer lifecycle\nbaseline. It reports median and p95 nanoseconds per operation, operations per\nsecond, 95% relative margin of error, and maximum active timers. JSON output\nincludes every sample, runtime and CPU information, Git state, and a correctness\nchecksum derived from the verified scheduler behavior trace. The checksum is\nindependent of benchmark timing, calibration, and selected scenarios.\n\nProfile real spinner rendering with Bun's CPU profiler:\n\n```bash\nbun --cpu-prof --cpu-prof-md --cpu-prof-dir ./profiles \\\n  profile/spinner-cpu-profile.ts \\\n  --count=100 --duration-ms=15000 --interval=80 --mode=staggered\n```\n\nThe profiling scenario uses OpenTUI's test renderer with native timers and\nreports process CPU time, spinner render requests, rendered frames, effective\nFPS, and whether rendering stayed within OpenTUI's configured 60 FPS limit.\nAvailable modes are `aligned`, `hidden`, `staggered`, and `mixed`.\n\n## Available Spinners\n\nThe library includes 80+ spinners from [cli-spinners](https://github.com/sindresorhus/cli-spinners). Popular choices include:\n\n- `dots` - Simple dots (⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏)\n- `dots2` - Alternative dots\n- `dots3` through `dots12` - Various dot styles\n- `line` - Rotating line (- \\\\ | /)\n- `pipe` - Simple pipe animation\n- `star` - Rotating star\n- `arc` - Arc animation\n- `circle` - Circle segments\n- `squareCorners` - Rotating square corners\n- `circleQuarters` - Quarter circles\n- `circleHalves` - Half circles\n- `bouncingBar` - Bouncing bar\n- `bouncingBall` - Bouncing ball\n- `arrow` - Arrow animations\n- `hamburger` - Hamburger menu animation\n- `growVertical` / `growHorizontal` - Growing bars\n- `balloon` / `balloon2` - Balloon animations\n- `noise` / `bounce` - Various effects\n- `boxBounce` - Bouncing box\n- `weather` - Weather icons\n- `moon` - Moon phases\n- `runner` - Running character\n- `pong` - Pong animation\n- `shark` - Shark animation\n- `dqpb` - Letter rotation\n\nSee the full list at [cli-spinners](https://github.com/sindresorhus/cli-spinners#readme).\n\n## Custom Spinners\n\nCreate your own spinner with custom frames:\n\n```typescript\nconst spinner = new SpinnerRenderable(renderer, {\n  frames: [\"◐\", \"◓\", \"◑\", \"◒\"],\n  interval: 80,\n  color: \"magenta\",\n});\n```\n\n## Color Options\n\nColors can be specified in multiple formats:\n\n```typescript\n// Named colors\nspinner.color = \"red\";\nspinner.color = \"cyan\";\n\n// RGB values\nspinner.color = { r: 255, g: 100, b: 50 };\n\n// Hex colors\nspinner.color = \"#ff6432\";\n```\n\n### Dynamic Color Effects\n\nThe `color` property also accepts a `ColorGenerator` function for dynamic color effects:\n\n```typescript\nimport { SpinnerRenderable, type ColorGenerator } from \"opentui-spinner\";\n\n// Custom color generator\nconst customColorGen: ColorGenerator = (\n  frameIndex,\n  charIndex,\n  totalFrames,\n  totalChars\n) => {\n  // Return different colors based on frame/character position\n  return frameIndex % 2 === 0 ? \"cyan\" : \"magenta\";\n};\n\nconst spinner = new SpinnerRenderable(renderer, {\n  name: \"dots\",\n  color: customColorGen,\n});\n```\n\n### Built-in Color Generators\n\n#### `createPulse(colors, speed?)`\n\nCreates a pulsing effect that cycles through colors:\n\n```typescript\nimport { SpinnerRenderable, createPulse } from \"opentui-spinner\";\n\nconst spinner = new SpinnerRenderable(renderer, {\n  name: \"dots\",\n  color: createPulse([\"red\", \"orange\", \"yellow\"], 0.5),\n});\n```\n\n**Parameters:**\n\n- `colors`: Array of colors to cycle through\n- `speed`: Animation speed multiplier (default: 1.0)\n\n#### `createWave(colors)`\n\nCreates a wave pattern that moves across characters:\n\n```typescript\nimport { SpinnerRenderable, createWave } from \"opentui-spinner\";\n\nconst spinner = new SpinnerRenderable(renderer, {\n  name: \"dots\",\n  color: createWave([\"#ff0000\", \"#00ff00\", \"#0000ff\"]),\n});\n```\n\n**Parameters:**\n\n- `colors`: Array of colors for the wave gradient\n\n## Examples\n\nCheck out the `examples/` directory for complete working examples:\n\n- [`examples/index.ts`](examples/index.ts) - Core example\n- [`examples/react.tsx`](examples/react.tsx) - React example\n- [`examples/solid.tsx`](examples/solid.tsx) - SolidJS example\n\n## Peer Dependencies\n\n- `@opentui/core` (required)\n- `@opentui/react` (optional, for React support)\n- `@opentui/solid` (optional, for SolidJS support)\n\n## Development\n\n```bash\n# Install dependencies\nbun install\n\n# Build the library\nbun run build\n\n# Lint code\nbun run lint\n\n# Auto-fix linting issues\nbun run lint:fix\n```\n\n## License\n\nMIT\n\n## Credits\n\n- Built on [OpenTUI](https://github.com/opentui/opentui)\n- Spinners from [cli-spinners](https://github.com/sindresorhus/cli-spinners) by Sindre Sorhus\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","readmeFilename":"README.md"}