Skip to content

Progress Pool

Star
👑Pioneer

TuiProgressPool is a highly decorative progress display component. It simulates the visual effects of a "water tank" or "battery charging," supporting wave animations (Wave), dashed borders (Dash Border), and various color gradient strategies. When paired with TuiProgressPoolGroup, it can easily achieve queue animation effects.

Basic Usage

Basic Display

The simplest usage involves configuring value and label. By default, the component automatically calculates the percentage and wraps it in a high-tech dashed border.

html
<template>
  <div style="width: 300px; height: 100px;">
    <TuiProgressPool 
      :value="60" 
      label="Basic Progress Pool" 
    />
  </div>
</template>

Visual Effects

Wave Fill (Wave)

Set fillContent="wave" to enable the liquid level wave animation. You can finely control the height, number of segments, and animation duration of the waves to simulate the effect of a moving liquid surface.

  • waveHeight: The height of the wave ripples.
  • waveSegments: The number of wave peaks.
html
<template>
  <TuiProgressPool 
    :value="45" 
    label="Level Monitoring" 
    fillContent="wave"
    :waveHeight="10"
    :waveSegments="4"
    :colors="['#409eff', '#36cfc9']" 
  />
</template>

Shape and Direction

  • shape: Supports square (default rectangle) and circle.
  • barDirection: Controls the growth direction of the internal progress bar (h for horizontal, v for vertical).
html
<template>
  <TuiProgressPool 
    :value="75" 
    shape="circle" 
    barDirection="v"
    fillContent="wave"
    label="Tank Capacity" 
    unit="L"
    :width="150"
  />
</template>

Values and Thresholds

Numerical Display Logic

The component provides powerful numerical display configurations:

  • maxValue: Sets the maximum value used to calculate the percentage (defaults to 100).

  • displayValue: Controls the displayed content.

  • auto: Automatic display.

  • all: Displays both the percentage and the actual value.

  • allReverse: Reverses the primary and secondary display positions of the percentage and actual value.

  • unit: Numerical unit.

Smart Thresholds (Thresholds)

Through the thresholds object, you can automatically switch color states based on the numerical value. It supports defining breakpoints for five states: critical, danger, warning, normal, and success.

html
<script setup>
const myThresholds = {
  danger: 20,   // 0-20
  warning: 50,  // 21-50
  normal: 80,   // 51-80
  success: 100  // 81+
};
</script>

<template>
  <TuiProgressPool 
    :value="85" 
    :thresholds="myThresholds"
    label="Health Score" 
  />
</template>

Progress Pool Group

Using TuiProgressPoolGroup allows you to render a set of progress pools and supports queue animations (playing entrance animations one after another).

  • queueInit: Whether to enable queue initialization animation (defaults to true).
  • progressPoolConfig: Uniformly configures the style properties for all internal items.
html
<script setup>
const items = [
  { label: "Node A", value: 32 },
  { label: "Node B", value: 65 },
  { label: "Node C", value: 89 }
];

const poolConfig = {
  fillContent: 'wave',
  barDirection: 'v', // Vertical bar effect
  gradientAni: true  // Enable gradient light animation
};
</script>

<template>
  <div style="height: 300px">
    <TuiProgressPoolGroup 
      :items="items" 
      :progressPoolConfig="poolConfig"
      :gap="20"
    />
  </div>
</template>

API Reference

TuiProgressPool Props

PropertyTypeDefaultDescription
valueNumber0Current value.
maxValueNumbernullMaximum value. If not provided, percentage is calculated based on 100.
labelStringRequiredTitle/label text.
unitString''Numerical unit.
shapeString'square'Shape. Options: square, circle.
fillContentString'bar'Type of fill content. Options: bar (standard), wave (wave).
colorsString/ArraynullColor configuration. Supports a single color string or [startColor, endColor] gradient array.
barDirectionString'h'Progress growth direction. Options: h, v.
labelPostionString'top'Label position. Options: top, left, right, bottom.
displayValueString'auto'Numerical display mode. Options: none, auto, all, allReverse.
statusString-Force a specific status color (success, warning, etc.).
thresholdsObject-Threshold configuration object.
barDashArray[5, 2]Dashed line configuration for the internal progress bar [line length, gap length].
borderWidthNumber3Outer frame border width.
borderGapNumber3Gap between the outer frame and internal progress.
borderRadiusNumber5Border corner radius.
gradientTypeString'linear'Gradient type. Options: linear, radial.
gradientAniBooleanfalseWhether to enable gradient light animation.
waveHeightNumber20Wave height (px).
waveSegmentsNumber6Number of wave segments.
aniDelayNumber2000Initial animation delay (ms).
durationNumber-Animation duration (ms).
resizeObserverString'global'Size monitoring strategy.

TuiProgressPoolGroup Props

PropertyTypeDefaultDescription
itemsArray[]Data source array; items contain { label, value }.
progressPoolConfigObject-Props configuration object passed uniformly to internal TuiProgressPool components.
gapNumber-Spacing between elements in the group.
directionString'h'Group arrangement direction. Options: h, v.
queueInitBooleantrueWhether to enable queued delayed initialization (playing entrance animations in sequence).
labelWidthNumber-Uniform label width (for alignment).

Emits

Event NameDescriptionCallback Parameters
initedTriggered when the component initialization animation completes.-

Released under the MIT License.