LinearProgressIndicator
LinearProgressIndicator 在水平轨道上显示确定或不确定进度。
示例
默认
数值动画
不确定进度
参考
结构
| 元素 | 部件 | 选择器 |
|---|---|---|
<div> | root | [data-scope="linear-progress-indicator"][data-part="root"]鼠标左键单击复制 |
<div> | viewport | [data-scope="linear-progress-indicator"][data-part="viewport"]鼠标左键单击复制 |
<div> | track | [data-scope="linear-progress-indicator"][data-part="track"]鼠标左键单击复制 |
<div> | active-indicator | [data-scope="linear-progress-indicator"][data-part="active-indicator"]鼠标左键单击复制 |
<span> | active-indicator-flat | [data-scope="linear-progress-indicator"][data-part="active-indicator-flat"]鼠标左键单击复制 |
<svg> | active-indicator-wavy条件显示 | [data-scope="linear-progress-indicator"][data-part="active-indicator-wavy"]鼠标左键单击复制 |
<div> | stop-indicator条件显示 | [data-scope="linear-progress-indicator"][data-part="stop-indicator"]鼠标左键单击复制 |
属性
| 名称 | 说明 | 默认值 | 控件 |
|---|---|---|---|
indeterminate可选 | Whether the progress value is unknown. boolean | undefined | false | |
value可选 | Current progress value. number | undefined | 0 | |
min可选 | Minimum progress value. number | undefined | 0 | |
max可选 | Maximum progress value. number | undefined | 1 | |
direction可选 | Drawing direction for the visual indicator. ltrrtl | "ltr" | |
shape可选 | Visual shape of the active indicator. flatwavy | "flat" | |
thickness可选 | CSS length used for the track and active indicator thickness. string | undefined | - | |
trackGap可选 | CSS length used for the gap between active indicator and track. string | undefined | - | |
stopIndicator可选 | Whether to draw the linear stop indicator at the track end. boolean | undefined | true | |
stopIndicatorSize可选 | CSS length used for the stop indicator size. string | undefined | - | |
waveAmplitude可选 | CSS length used for the wavy active indicator amplitude. string | undefined | - | |
wavelength可选 | CSS length used for the determinate wavy active indicator wavelength. string | undefined | - | |
indeterminateWavelength可选 | CSS length used for the indeterminate wavy active indicator wavelength. string | undefined | - | |
ariaLabel可选 | Accessible label. string | undefined | - | - |
ariaValueText可选 | Accessible value text. Defaults to a percentage for determinate progress. string | undefined | - | - |
样式14
| Token | 说明 |
|---|---|
--md-progress-indicator-colorColor回退值 var(--md-color-on-container, var(--md-sys-color-primary)) | Shared active indicator color for progress indicators. |
--md-progress-indicator-track-colorColor回退值 var(--md-color-container, var(--md-sys-color-secondary-container)) | Shared track color for progress indicators. |
--md-progress-indicator-stop-indicator-colorColor回退值 var(--md-progress-indicator-color) | Shared stop indicator color for linear progress. |
--md-linear-progress-indicator-active-indicator-colorColor回退值 var(--md-progress-indicator-color) | Active segment color for the linear indicator. |
--md-linear-progress-indicator-track-colorColor回退值 var(--md-progress-indicator-track-color) | Track color for the linear indicator. |
--md-linear-progress-indicator-stop-indicator-colorColor回退值 var(--md-progress-indicator-stop-indicator-color) | Stop indicator color for determinate linear progress. |
--md-linear-progress-indicator-track-thicknessLayout回退值 4dp × typography/density scale | Height of the track and active segment. |
--md-linear-progress-indicator-track-active-indicator-gapLayout回退值 4dp × typography/density scale | Gap between active segment and track in determinate partial state. |
--md-linear-progress-indicator-stop-indicator-sizeLayout回退值 4dp × typography/density scale | Size of the stop indicator dot. |
--md-linear-progress-indicator-shapeShape回退值 var(--md-shape-indicator) | Corner radius for track, active segment, and stop indicator. |
--md-linear-progress-indicator-wave-amplitudeWave回退值 3dp × typography/density scale | Amplitude for the wavy active segment. |
--md-linear-progress-indicator-wave-wavelengthWave回退值 40dp × typography/density scale | Wavelength for determinate wavy progress. |
--md-linear-progress-indicator-indeterminate-wave-wavelengthWave回退值 20dp × typography/density scale | Wavelength for indeterminate wavy progress. |
--md-linear-progress-indicator-with-wave-heightWave回退值 10dp × typography/density scale | Minimum height when using the wavy shape. |