OneScript

ProgressView

Show the progress of a task.

Without value, ProgressView shows an indeterminate spinner. With value, it shows how much of total is done. children is the label.

import { ProgressView } from "onescript/views"

<ProgressView>Loading…</ProgressView>
import { ProgressView } from "onescript/views"

<ProgressView
  value={done}
  total={files.length}
  currentValueLabel={`${done} of ${files.length} files`}
>
  Downloading
</ProgressView>
PropTypeDescription
valuenumberCompleted amount, from 0 to total. Omit it for indeterminate progress.
totalnumberPositive amount that represents completion. Defaults to 1.
currentValueLabelViewChildDescribes the current progress, such as "3 of 10".
childrenViewChildThe label.

total and currentValueLabel require value. A value outside 0...total throws a TypeError.

Use progressViewStyle to choose a linear bar or a spinner. Also accepts Modifiers. It is available in App, Action, and Widget views.

How is this guide?

Last updated on