Overview

Display status information and tips.

Import

import { StatusBar } from 'nikcli-tui';

Usage

new StatusBar({ parent: screen, content: 'Ready' });

Live Preview

Run Locally

npm run tsx:core-gallery

Props

  • items: Array of { text: string; color?: string; icon?: string; clickable?: boolean; onClick?: () => void }
  • separator?: string — Text between items (default | ).
  • showIcons?: boolean — Prepend icons.
  • itemSpacing?: number — Reserved; items use separator.

Methods

  • setItems(items), addItem(item), removeItem(index), updateItem(index, item).
  • setItemText(i, text), setItemColor(i, color), setItemIcon(i, icon), setItemClickable(i, bool, onClick?).
  • setSeparator(text), setShowIcons(bool), setItemSpacing(n), clearItems().
  • getItemCount(), getItem(i), getAllItems(), findItemByText(text).
  • getStatusBarWidth(), setStatusBarWidth(width).

Installation

npm i nikcli-tui

Import

import { StatusBar } from 'nikcli-tui';

Quick Start

new StatusBar({ parent: screen, bottom: 0, left: 0, right: 0, items: [ { text: 'Ready' }, { text: 'q: quit', color: 'gray' } ] });

Production Examples

new StatusBar({ parent: screen, bottom: 0, left: 0, right: 0, showIcons: true,
  items: [ { text: '⚙ Settings', clickable: true, onClick: () => console.log('settings') } ]
});

Best Practices

  • Mantieni il contenuto poco intrusivo (altezza 1) e leggibile.