Skip to content
portalbits
Home Docs GitHub(opens in a new tab)

Guides

Get startedFoundationsMotion

Components

All components

Buttons

ButtonIconButton

Inputs

InputSelectTextareaSlider

Selection

CheckboxToggleToggleGroupSwitchRadioGroup

Identity

AvatarBadge

Overlays

DialogPopoverTooltipDropdownMenuAlertDialog

Disclosure

TabsAccordion

Cards

AppCardArticleCardFeatureCard

Content

CarouselSectionHeaderEmptyStateAlertProgressSeparatorRowListRow

Chrome

PortalShellSidebarNavMobileNavTopBarAuthFrameColorSelectorFloatingNav

Progress

How far a task has come, or that it is still working.

Uploading photos 64%
Variations

Source

<script lang="ts">
  import 'portal-bits/styles.css';
  import 'portal-bits/tokens.css';
  import type { Snippet } from 'svelte';

  let { children }: { children: Snippet } = $props();
</script>

{@render children()}
<script lang="ts">
  import ProgressExample from './ProgressExample.svelte';
</script>

<ProgressExample indeterminate={false} showValue={true} />
<script lang="ts">
  import { Button, Progress } from 'portal-bits';
  let {
    indeterminate = false,
    showValue = true,
  }: { indeterminate?: boolean; showValue?: boolean } = $props();
  let uploaded = $state(64);
</script>

<div class="stack">
  <Progress
    label={indeterminate ? 'Preparing files' : 'Uploading photos'}
    value={indeterminate ? null : uploaded}
    {showValue}
  />
  <div class="actions">
    <Button
      size={32}
      disabled={indeterminate}
      onclick={() => (uploaded = Math.max(0, uploaded - 16))}>Back</Button
    >
    <Button
      size={32}
      variant="primary"
      disabled={indeterminate}
      onclick={() => (uploaded = Math.min(100, uploaded + 16))}>Advance</Button
    >
  </div>
</div>

<style>
  .stack {
    display: grid;
    gap: 16px;
    width: 360px;
    max-width: 100%;
  }
  .actions {
    display: flex;
    gap: 8px;
  }
</style>

API reference

These tables list the props and snippets that Progress declares. Attributes passed through to an element or primitive are listed under Forwarded attributes, not here.

Props

NameTypeDefaultRequiredBindingDescription
labelstringNoneYesOne-wayThe visible label. It names the progress bar.
valuenumber | nullnullNoOne-wayProgress toward `max`. `null` means indeterminate.
maxnumber100NoOne-wayThe value that means done.
showValuebooleantrueNoOne-wayShows the rounded percentage beside the label.
classstring""NoOne-wayExtra classes, added after the component classes.

Forwarded attributes

None. Progress forwards no attributes.

The primitive underneath is a Bits UI peer dependency. Its own options are documented in the Bits UI Progress documentation. Only the props listed on this page are part of the Progress contract. No data attributes are documented as stable.

Limits

  • The track and sweep are an adaptation. Reduced motion swaps the sweep for a slow fade.
  • Values outside 0 to `max` are clamped for display.

Related

  • Slider
  • Alert
Previous Alert Next Separator

On this page

  • Preview
  • Source
  • API reference
  • Props
  • Forwarded attributes
  • Limits