Overview

Displays the current location within a hierarchy.

Installation

npm i nikcli-tui

Import

import { Breadcrumb } from 'nikcli-tui';

Quick Start

new Breadcrumb({ parent: screen, items: [ { label: 'Home', id: 'home' }, { label: 'Library', id: 'lib' } ] });

Live Preview

Run Locally

npm run tsx:core-gallery

Production Examples

const trail = new Breadcrumb({ parent: screen, top: 1, left: 2, items: [ { id: 'home', label: 'Home' } ] });
trail.addItem({ id: 'library', label: 'Library' });
trail.addItem({ id: 'data', label: 'Data' });

Props

  • items: Array of { id: string; label: string; href?: string; disabled?: boolean } — Breadcrumb segments.
  • separator?: string — Text separator between items (default ).
  • BaseProps: variant, size, position, height=1, etc.

Methods

  • setItems(items), addItem(item), removeLastItem(), clear().

Best Practices

  • Avoid long labels; trim or abbreviate to fit small terminals.