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

    Function progressBar

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

      Import this adapter from blessed-components/progress-bar/blessed. Use renderProgressBar from blessed-components/progress-bar when a Blessed element is unnecessary.

      The adapter:

      • renders initial content through renderProgressBar;
      • disables Blessed tags to keep dynamic text literal;
      • updates the existing element through setData;
      • leaves screen rendering under caller control;
      • detaches its element through destroy.

      Parameters

      Returns ProgressBarHandle

      A handle for the created element, updates, and cleanup.

      RangeError Propagates validation errors from renderProgressBar.

      import blessed from 'blessed';
      import { progressBar } from 'blessed-components/progress-bar/blessed';

      const screen = blessed.screen({ smartCSR: true });
      const upload = progressBar({
      parent: screen,
      box: {
      top: 0,
      left: 0,
      width: 40,
      height: 1,
      },
      data: {
      label: 'Uploaded',
      value: 25,
      width: 20,
      },
      });

      screen.render();

      upload.setData({
      label: 'Uploaded',
      value: 75,
      width: 20,
      });
      screen.render();

      upload.destroy();
      screen.destroy();