MD3
Expressive
MATERIAL DESIGN 3 EXPRESSIVE

Progress Indicator

Progress indicators show the status of a process in real time.

Progress indicators show the real-time status of a process. Features include determinate and indeterminate modes, circular indicators, and expressive wavy linear bars.

Introduction

The MD3 Expressive Progress Indicator provides visual feedback for tasks that take more than a few seconds. It supports both Linear and Circular formats, and offers a unique Wavy design style that adds a layer of sophisticated motion to the standard progress bar. It handles both determinate (known progress) and indeterminate (unknown duration) states gracefully.

Anatomy

  • Track: The background line or circle representing the total progress.
  • Indicator: The active part of the bar or circle representing completed progress.
  • Wavy Element (Optional): A dynamic SVG path that adds a wave effect to the indicator.

Variants

Linear Progress

Horizontal bars that are ideal for placement at the top of a surface or container.

Loading demo...

Circular Progress

Circular indicators that are best for smaller spaces or when a more centered focus is required.

Loading demo...

Features

Determinate vs Indeterminate

  • Determinate: Use when the percentage of completion is known.
  • Indeterminate: Use when the duration of the task is unknown.

Wavy Motion

The shape="wavy" prop transforms the flat progress bar into an animated wave. This expressive style is perfect for high-end interfaces that want to stand out.

Loading demo...

Use Cases & Integration

Practical examples of progress indicators integrated into action controls like buttons during async operations.

Loading demo...

Usage

Basic Linear Progress

import { ProgressIndicator } from "@bug-on/m3-expressive";

<ProgressIndicator value={60} aria-label="Loading profile status" />

Indeterminate Circular Progress

<ProgressIndicator variant="circular" aria-label="Loading resources" />

Expressive Wavy Progress

<ProgressIndicator 
  shape="wavy" 
  value={45} 
  amplitude={6} 
  wavelength={30} 
  aria-label="Processing video export"
/>

Best Practices

Do

  • Use Determinate progress whenever the duration can be calculated.
  • Provide an aria-label that describes what is being loaded.
  • Use Linear progress for long processes like file uploads or page loads.
  • Use Circular progress for smaller, contextual loading (e.g., inside a card).

Don't

  • Don't use a progress indicator if the task takes less than 1 second.
  • Don't switch between determinate and indeterminate states frequently; it can be confusing.
  • Avoid using too many wavy indicators on a single page, as the motion can be distracting.

Accessibility

  • Roles: Automatically applies role="progressbar".
  • States: Manages aria-valuenow, aria-valuemin, and aria-valuemax for determinate states.
  • Indeterminate: Removes aria-valuenow to signal unknown progress to screen readers.

API Reference

ProgressIndicator

Component ProgressIndicator nhận các thuộc tính chung cùng các cấu hình đặc trưng tùy theo kiểu hiển thị linear hoặc circular.

Shared Props (Thuộc tính dùng chung)

PropTypeDefaultDescription
aria-labelstringBắt buộc. Nhãn mô tả tiến trình phục vụ cho khả năng tiếp cận (Accessibility).
valuenumberPhần trăm tiến trình hoàn thành (từ 0 đến 100). Nếu truyền, component hiển thị ở trạng thái Determinate. Nếu bỏ qua, component tự động hoạt động ở trạng thái Indeterminate.
trackHeightnumberĐộ dày của thanh tiến trình (đối với Linear là chiều cao thanh, đối với Circular là độ dày đường viền vẽ vòng tròn, đơn vị px).
colorstring"currentColor"Màu sắc của phần tiến trình đang chạy.
trackColorstringMàu sắc của đường ray nền (phần chưa hoàn thành).
classNamestringLớp CSS bổ sung cho container bên ngoài.

Linear-specific Props (Chỉ áp dụng khi variant="linear")

PropTypeDefaultDescription
variant"linear""linear"Xác định kiểu hiển thị dạng thanh ngang.
shape"flat" | "wavy""flat"Kiểu dáng thiết kế của thanh chỉ báo tiến trình đang chạy.
trackShape"flat" | "wavy""flat"Kiểu dáng thiết kế của đường ray nền.
amplitudenumber4Biên độ (độ cao đỉnh sóng) khi dùng kiểu wavy.
wavelengthnumber20Chiều dài bước sóng của một chu kỳ sóng ở trạng thái Determinate Wavy.
indeterminateWavelengthnumberChiều dài bước sóng dành riêng cho chế độ Indeterminate Wavy.
gapSizenumberKhoảng trống phân tách giữa thanh chạy và đường ray nền. Đặt 0 để tạo làn sóng liền mạch.
waveSpeednumber1Hệ số điều chỉnh tốc độ chuyển động cuộn của sóng.
crawlerSpeednumber1Hệ số điều chỉnh tốc độ di chuyển của thanh trượt trong trạng thái Indeterminate.
determinateAnimation"md3" | "continuous""md3"Cơ chế làm giảm độ cao sóng khi tiến trình gần chạm biên (dưới hoặc bằng 10% hoặc lớn hơn hoặc bằng 90%). "md3" làm phẳng sóng dần về 0; "continuous" giữ nguyên biên độ sóng suốt chiều dài.
indeterminateAnimation"md3" | "continuous""md3"Kiểu chuyển động khi chạy vô hạn. "md3" sử dụng hiệu ứng 2 thanh trượt co giãn vật lý; "continuous" sử dụng dải chạy lặp liên tục mượt mà.
showStopIndicatorboolean | "auto"Hiển thị chấm tròn kết thúc ở góc cuối đường ray. "auto" sẽ chỉ hiển thị và mờ dần (fade-in) khi tiến độ đạt 100%.

Circular-specific Props (Chỉ áp dụng khi variant="circular")

PropTypeDefaultDescription
variant"circular"Xác định kiểu hiển thị dạng vòng tròn xoay.
sizenumber48Đường kính hiển thị của vòng tròn (px).
shape"flat" | "wavy""flat"Kiểu nét vẽ vòng tròn (nét trơn phẳng hoặc nét lượn sóng).
trackShape"flat" | "wavy""flat"Kiểu nét vẽ của đường ray nền khi shape="wavy" ở Determinate mode (nét trơn phẳng hoặc nét lượn sóng).
amplitudenumberBiên độ dao động sóng quanh viền tròn.
wavelengthnumberTổng số chu kỳ sóng phân bố đều trên chu vi vòng tròn.
gapSizenumberKhoảng cách phân cách giữa hai đầu của cung tiến trình.
waveSpeednumber1Hệ số điều chỉnh tốc độ chuyển động cuộn của sóng.
determinateAnimation"md3" | "continuous""md3"Cơ chế phẳng sóng ở các mốc biên (dưới hoặc bằng 10% hoặc lớn hơn hoặc bằng 95%). "md3" làm phẳng nét sóng về đường tròn thẳng ở 0% và 100%; "continuous" giữ nét sóng cuộn liên tục ở mọi mức tiến độ.
crawlerSpeednumberTốc độ quay của cung trượt trong trạng thái Indeterminate.
showTrackboolean | "auto""auto"Hiển thị đường ray nền phía sau trong trạng thái Indeterminate. "auto" tự động ẩn với flat và hiện với wavy.
minProgressnumber0.1Tỷ lệ chiều dài cung tối thiểu (từ 0 đến 1) khi co giãn ở trạng thái Indeterminate.
maxProgressnumber0.8Tỷ lệ chiều dài cung tối đa (từ 0 đến 1) khi co giãn ở trạng thái Indeterminate.
amplitudeRange[number, number][0, effectiveAmplitude]Khoảng biến thiên biên độ sóng [min, max] ở trạng thái Indeterminate. Giúp sóng phẳng đi khi cung thu ngắn và đạt biên độ tối đa khi cung giãn dài.