Skip to content

Progress

A progress bar with a label and a note.

Updated View as Markdown
Preview

Loading preview…

root = Stack(Progress(72, "Onboarding", note:"18 of 25 steps"), Progress(4.2, "Storage", max:5, note:"4.2 of 5 GB", tone:warning))

Signature

This is the line a model reads in the system prompt.

Progress(value:num, label?, max:num, note:str, tone:Tone)
  • Group: Data
  • Children: No
  • Positional arguments: value, label? (a trailing ? means it may be left out)

Props

Prop Type How to write it Notes
value number positional, required
label string positional, optional
max number named: max:… Default 100.
note string named: note:…
tone neutral · info · success · warning · danger · accent named: tone:… Also accepts error, red, green, blue, yellow, primary.

Use your own component

Keep the name and schema, swap what is drawn. The prompt and the model’s output do not change.

import { ui } from "@gistui/react/ui";

const lib = ui.extend({ Progress: MyProgress });
<GistUI library={lib} stream={response.body} />;
<GistUI :source="answer" :components="{ Progress: MyProgress }" />
<GistUI source={answer} components={{ Progress: MyProgress }} />
<GistUI source={answer()} components={{ Progress: MyProgress }} />
import { ui } from "@gistui/vanilla/ui";

const lib = ui.extend({ Progress: (ctx) => ({ el: myElement(ctx) }) });

See Custom components for the full contract. Style hook: [data-gistui="Progress"].

Navigation

Type to search…

↑↓ navigate↵ selectEsc close