Components › Components

On this page

Progress

A native progress bar; without a value, it shows work in progress.

Usage #

tscl
@import uiProgress from './progress.tscl'

<div class="demo">
  <uiProgress [value]="40" label="Upload" />
  <uiProgress label="Loading" />
</div>

<style scoped>
  :scope {
    display: grid;
    gap: 12px;
    padding: 24px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: var(--ui-bg);
    color: var(--ui-fg);
  }
</style>

Source #

Copy it next to your components as progress.tscl.

tscl
{{-- Progress: a native <progress>. Without a value it is indeterminate (still working, amount unknown). --}}
@input value: number | null = null
@input max: number = 100
@input label: string = ''

<progress [max]="max" [value]="value" [aria-label]="label || null" data-part="progress"></progress>

<style scoped>
  @layer theme, base, components, utilities;
  @layer components {
    :where(:scope) {
      width: 100%;
      height: 8px;
      border: 0;
      border-radius: 999px;
      overflow: hidden;
      background: var(--ui-muted-bg);
      accent-color: var(--ui-accent);
      appearance: none;
    }
    :where(:scope)::-webkit-progress-bar {
      background: var(--ui-muted-bg);
    }
    :where(:scope)::-webkit-progress-value {
      background: var(--ui-accent);
      border-radius: 999px;
    }
    :where(:scope)::-moz-progress-bar {
      background: var(--ui-accent);
      border-radius: 999px;
    }
  }
</style>

Styling #

Needs #