Overview

Highlight status such as success, warning, or error.

Import

import { StatusIndicator } from 'nikcli-tui';

Usage

new StatusIndicator({ parent: screen, status: 'success', text: 'OK' });

Live Preview

Run Locally

npm run tsx:core-gallery

Props

  • status: ‘idle’ | ‘running’ | ‘success’ | ‘warning’ | ‘error’ — Visual state.
  • text?: string — Optional label.

Methods

  • setStatus(status, text?).

Installation

npm i nikcli-tui

Import

import { StatusIndicator } from 'nikcli-tui';

Quick Start

new StatusIndicator({ parent: screen, top: 1, left: 2, status: 'success', text: 'OK' });

Production Examples

const st = new StatusIndicator({ parent: screen, top: 1, left: 2, status: 'running', text: 'Working' });
setTimeout(() => st.setStatus('success', 'Done'), 1500);

Best Practices

  • Combina con LogViewer/Toast per contesto operativo.