> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sirius.menu/llms.txt
> Use this file to discover all available pages before exploring further.

# Progress

> A read-only bar showing how far along something is.

<a href="https://www.sentivel.com/?ref=sirius-docs" target="_blank" rel="noopener noreferrer" className="sv-banner">
  <span className="sv-banner-mark" aria-hidden="true">
    <svg viewBox="0 0 194.08 236.31" fill="currentColor">
      <path fillRule="evenodd" clipRule="evenodd" d="M181.21,89.15L137.69,99.7l21.82-14.53c15.69-10.45,26.19-27.08,28.88-45.73L194.08,0l0,0c-18.79,13.86-40.77,22.76-63.91,25.86L72.27,33.6c-23.32,3.12-44.43,16.31-56.32,36.62C6.1,87.06,2.64,107.65,7.91,128.02l1.04,4.01l48.67,5.2l0,0C30.7,143.2,10.28,165.2,6.34,192.49L0,236.31l0,0c28.49-17.35,60.53-28.03,93.73-31.26l25.54-2.48c29.96-2.91,56.12-22.72,65.53-51.32c4.42-13.44,5.16-28.26,1.36-42.96L181.21,89.15z M115.85,143l-23.2,6.02c-8.99,2.31-18.13-3.06-20.47-12.05l-5.99-23.2c-2.34-8.99,3.06-18.16,12.03-20.47l23.22-6.02c8.97-2.31,18.13,3.08,20.47,12.05l5.99,23.22C130.24,131.52,124.84,140.69,115.85,143z" />
    </svg>
  </span>

  <span className="sv-banner-copy">
    <span className="sv-banner-title">
      Sentivel
      <span className="sv-banner-badge">Endorsed by Rayfield</span>
    </span>

    <span className="sv-banner-sub">Status pages and uptime monitoring for whatever you ship. Free to start.</span>
  </span>

  <span className="sv-banner-cta">
    Take a look
    <span className="sv-banner-arrow" aria-hidden="true">→</span>
  </span>
</a>

<Note>
  Preview only. This is on the [preview channel](/rayfield-gen2/preview) and is not in the stable release. It can change or be dropped before it lands there.
</Note>

A progress bar shows how far through a range a value sits. It takes a range the way a slider does, reads as a percentage unless you say otherwise, and is read-only - it carries no flag and saves nothing.

```lua theme={null}
local download = tab:CreateProgress({
    name = "Download",
    range = { 0, 100 },
    value = 35,
})

download:Set(80)
```

Set `steps` to draw the track as a row of segments instead of one continuous fill, for something that moves through stages rather than a distance.

```lua theme={null}
tab:CreateProgress({ name = "Setup", steps = 5, value = 2 }) -- reads "2/5"
```

Set `indeterminate` when you don't know how long the work will take. The bar sweeps instead of filling, and the first `Set` ends the sweep.

```lua theme={null}
local syncing = tab:CreateProgress({ name = "Syncing", indeterminate = true })
syncing:Set(1) -- done sweeping, now showing a value
```

## Properties

<ResponseField name="name" type="string">
  The label.
</ResponseField>

<ResponseField name="description" type="string">
  Hint text under the label. Optional.
</ResponseField>

<ResponseField name="icon" type="string | number">
  An icon shown beside the label. Optional.
</ResponseField>

<ResponseField name="range" type="{ number }" default="{ 0, 1 }">
  The bounds, as `{ min, max }`. With `steps` set and no range given, it defaults to `{ 0, steps }` so the value counts stages.
</ResponseField>

<ResponseField name="value" type="number" default="min">
  The initial value. Anything outside the range is clamped.
</ResponseField>

<ResponseField name="steps" type="number">
  Draw the track as this many segments. Needs at least 2; anything less is ignored and the bar stays continuous.
</ResponseField>

<ResponseField name="text" type="string">
  A fixed readout beside the label, in place of the percentage.
</ResponseField>

<ResponseField name="format" type="function">
  Build the readout yourself: `(value, min, max) -> string`. Ignored while `text` is set.
</ResponseField>

<ResponseField name="showValue" type="boolean" default="true">
  Set false to hide the readout and show the track alone.
</ResponseField>

<ResponseField name="indeterminate" type="boolean" default="false">
  Sweep instead of filling, for work of unknown length.
</ResponseField>

## Handle

<ResponseField name=".value" type="number">
  The current value.
</ResponseField>

<ResponseField name="Set(value)">
  Set the value. Ends the sweep if the bar was indeterminate.
</ResponseField>

<ResponseField name="Get()" type="number">
  The current value.
</ResponseField>

<ResponseField name="GetPercentage()" type="number">
  Where the value sits in its range, 0 to 1.
</ResponseField>

<ResponseField name="SetRange(min, max)">
  Move the bounds. The value comes with them, clamped to whatever the new range allows.
</ResponseField>

<ResponseField name="SetText(text?)">
  Replace the readout, or pass nothing to go back to the formatter or the percentage.
</ResponseField>

<ResponseField name="SetIndeterminate(state)">
  Switch between a real value and the waiting sweep.
</ResponseField>
