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

    Interface RenderProgressBarOptions

    Options accepted by renderProgressBar.

    The renderer maps value from the inclusive numeric range defined by min and max into a fixed-width terminal track. Values outside the range are clamped before rendering.

    renderProgressBar({
    value: 50,
    width: 10,
    });
    // "█████░░░░░ 50%"
    renderProgressBar({
    label: 'Workers',
    min: 0,
    max: 8,
    value: 6,
    width: 8,
    });
    // "Workers ██████░░ 75%"
    interface RenderProgressBarOptions {
        characters?: ProgressBarCharacters;
        formatValue?: (context: ProgressBarValueContext) => string;
        label?: string;
        max?: number;
        min?: number;
        value: number;
        width: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    Characters used to render filled and empty cells.

    Each character should occupy one terminal cell. Multi-cell or combining characters can make the visible track wider than width.

    { filled: '█', empty: '░' }

    formatValue?: (context: ProgressBarValueContext) => string

    Formats the value text appended after the track.

    The callback receives the clamped numeric value and its rounded percentage. Returning an empty string leaves the trailing separator in place; callers that need a track-only representation should account for that when composing output.

    ({ percentage }) => ${percentage}%``

    label?: string

    Optional text rendered before the track.

    Dynamic values must be escaped by the caller if the returned string will later be inserted into a Blessed element with tags enabled. The bundled Blessed adapter disables tags.

    max?: number

    Upper bound of the numeric range.

    Must be finite and greater than min.

    100

    min?: number

    Lower bound of the numeric range.

    Must be finite and lower than max.

    0

    value: number

    Current numeric value.

    The value must be finite. Values below min or above max are clamped before the percentage and formatted value are calculated.

    width: number

    Number of characters reserved for the progress track.

    This excludes the optional label, spaces, and formatted value. It must be a positive integer.