Progress Bar

Display task progress as a horizontal bar.

Live preview
Interact with the component to see results here.
View code
HTML
<sy-progress-bar
  percent="65"
  status="default"
  valueposition="center"
  id="sample"
  aria-label="File processing progress"
></sy-progress-bar>
<div class="demo-actions"
  style="display:flex;flex-wrap:wrap;gap:8px;margin-top:16px"
>
  <sy-button id="action-0" size="small">Read current value</sy-button>
</div>
<output id="demo-result" aria-live="polite"></output>

<script type="module">
  const describeResult = value => JSON.stringify(value, (_key, item) => {
    if (item instanceof File) return {
      name: item.name,
      size: item.size,
      type: item.type
    };
    if (item instanceof Element) return `<${item.localName}>`;
    return item;
  }) ?? 'Done';
  const actionTarget0 = document.querySelector("#sample");
  document.querySelector('#action-0').addEventListener('click', async () => {
    const result = await actionTarget0.getValue();
    document.querySelector('#demo-result').textContent = describeResult(result);
  });
</script>

Usage guide

#

Show how far an upload or processing task has progressed with a horizontal bar.

Tasks with known progress

Pass 0–100 to percent and update it as the task progresses. Control status and number visibility with status and hidePercent.

Tasks with unknown completion time

Use indeterminate to indicate ongoing work. Do not display an arbitrary percentage.

Feature examples

#

Choose a feature from 10 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.

Usage examples · Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Property · Hide Percent

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Indeterminate

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Percent

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Segment

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Status

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Tooltip Title

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Value Position

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Methods · getValue

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Events · Changed

Interact with the component to see event names and payloads in the live preview below.

View code
HTML
Loading the example.

API reference

#

Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.

<sy-progress-bar>

Properties

Attribute / PropertyTypeDefaultDescription
booleanfalseIndicate ongoing work without showing a completion percentage.
number0Completed percentage of the total task, from 0 to 100.
'default' | 'error' | 'complete''default'Progress (default), error (error), or complete (complete) state.
'progress-left' | 'progress-center' | 'progress-right' | 'center' | 'left' | 'right''center'Place the value outside the bar or inside its filled portion.
booleanfalseHide the progress percentage.
string''JSON string containing cumulative end percentages and statuses. Example: [{"percent":35,"status":"complete"},{"percent":100}].
string''Progress tooltip title.

Events

EventDetailDescription
CustomEvent<{ percent: number }>Fires whenever `percent` changes. `event.detail.percent` is the new value (0–100, post-clamp).

Methods

MethodReturnsDescription
Promise<number>Return the current value or selected range.