blessed-components - v1.20.0
    Preparing search index...

    Function metricBars

    • Creates display-only MetricBars backed by a Blessed BoxElement.

      Import from blessed-components/metric-bars/blessed. The adapter disables Blessed tags, updates content through renderMetricBars, and leaves terminal rendering under caller control.

      Type Parameters

      • TMetric extends MetricBarItem

        Metric shape, including optional application metadata.

      Parameters

      Returns MetricBarsHandle<TMetric>

      Handle for the created box, updates, and cleanup.

      RangeError Propagates validation errors from renderMetricBars.

      import blessed from 'blessed';
      import { metricBars } from 'blessed-components/metric-bars/blessed';

      const screen = blessed.screen({ smartCSR: true });
      const score = metricBars({
      parent: screen,
      box: { top: 0, left: 0, width: 60, height: 5 },
      data: {
      barWidth: 16,
      label: 'Overall',
      value: '85%',
      metrics: [
      { label: 'Quality', value: 78 },
      { label: 'Popularity', value: 99 },
      ],
      },
      });

      screen.render();
      score.destroy();
      screen.destroy();