Overview

Animated spinner for async work.

Import

import { ProgressSpinner } from 'nikcli-tui';

Usage

new ProgressSpinner({ parent: screen });

Live Preview

Run Locally

npm run tsx:core-gallery

Props

  • text?: string — Base text.
  • intervalMs?: number — Frame interval (default 80ms).
  • bars?: string[] — Custom bar frames.
  • barCount?: number — Use only first N frames.

Methods

  • start(text?, intervalMs?), stop(), pause(), resume(), reset().
  • setText(text), setBars(frames), setBarCount(n), setInterval(ms), setCustomPattern(frames).
  • getCurrentBarIndex(), getCurrentBar(), isRunning().

Installation

npm i nikcli-tui

Import

import { ProgressSpinner } from 'nikcli-tui';

Quick Start

new ProgressSpinner({ parent: screen, top: 1, left: 2, text: 'Loading' });

Production Examples

const sp = new ProgressSpinner({ parent: screen, top: 1, left: 2, text: 'Fast', intervalMs: 50 });

Best Practices

  • Usa spinner per operazioni brevi; combina con Text/StatusBar per contesto.