Progress
How far along a task is.
Pass value as a number, or null while the amount of work is unknown: the bar then pulses
instead of filling.
Dependencies
What it's built from and what's built from it in Base, read from the imports in its source.
| Uses | Textprimitive |
|---|---|
| Used by | Nothing yet. |
| Packages | @ui-sdk/core@0.1.0-beta.20@ui-sdk/react@0.1.0-beta.20 |
Installation
Set the project up for Base once first, as Getting started shows. Then add it with the CLI, or by hand.
With the CLI
Manually
Install its packages:
Add the components it uses first, listed under Dependencies.
Then copy the source:
API reference
Generated from Base's types. Props marked ours are added here; the rest come from the ui-sdk part it wraps. Every part also accepts its element's native attributes.
Progress
A task's progress. Holds an optional ProgressLabel and ProgressValue, and a ProgressTrack with its indicator built in. Leave out value while the amount of work is unknown.
- className
Type string | ((state: NoInfer<ProgressState>) => string)
- debug
Logs every state change with its reason to the console, in development builds.
Type boolean
- format
How the value reads, for screen readers and the Value part:
Intl.NumberFormatoptions, or a function of the value. A percent style shows where the value sits betweenminandmax; any other style shows the value itself, like{ style: "unit", unit: "gigabyte" }.Type NumberFormat · Default { style: "percent" }
- getValueLabel
The text screen readers announce for the value, when the formatted value says too little, like "3 of 12 files". It receives the value, null while a progress bar is indeterminate, and details: the
formattedvalue, itspercent,minandmax.Type (value: number | null, details: GaugeLabelDetails<number | null>) => string
- locale
The locale the value is formatted in. Defaults to the page's
lang, or the browser's language without one, once the page is interactive. Server markup uses English until then, so it never disagrees with the client.Type string
- max
The highest value.
Type number · Default 100
- min
The lowest value.
Type number · Default 0
- render
Type RenderProp<NoInfer<ProgressState>>
- style
Type CSSProperties | ((state: NoInfer<ProgressState>) => CSSProperties)
- value
How far the task has come, between
minandmax. Null means it's under way but how far is unknown, and the bar is indeterminate.Type number | null · Default null
ProgressIndicator
The filled part of the bar. Pulses while the progress is unknown.
- children
Content, or a function of the part's state that returns it.
Type ReactNode | ((state: NoInfer<ProgressState>) => ReactNode)
- className
Class names, or a function of the part's state that returns them.
Type string | ((state: NoInfer<ProgressState>) => string)
- render
Renders your own element: one that receives the part's props, or a function of the props and the state.
Type RenderProp<NoInfer<ProgressState>>
- style
Styles, or a function of the part's state that returns them.
Type CSSProperties | ((state: NoInfer<ProgressState>) => CSSProperties)
ProgressLabel
Names the task.
- children
Content, or a function of the part's state that returns it.
Type ReactNode | ((state: NoInfer<ProgressState>) => ReactNode)
- className
Class names, or a function of the part's state that returns them.
Type string | ((state: NoInfer<ProgressState>) => string)
- render
Renders your own element: one that receives the part's props, or a function of the props and the state.
Type RenderProp<NoInfer<ProgressState>>
- style
Styles, or a function of the part's state that returns them.
Type CSSProperties | ((state: NoInfer<ProgressState>) => CSSProperties)
ProgressTrack
The bar, with its indicator built in unless you pass your own.
- children
Content, or a function of the part's state that returns it.
Type ReactNode | ((state: NoInfer<ProgressState>) => ReactNode)
- className
Class names, or a function of the part's state that returns them.
Type string | ((state: NoInfer<ProgressState>) => string)
- render
Renders your own element: one that receives the part's props, or a function of the props and the state.
Type RenderProp<NoInfer<ProgressState>>
- style
Styles, or a function of the part's state that returns them.
Type CSSProperties | ((state: NoInfer<ProgressState>) => CSSProperties)
ProgressValue
The formatted value, like 40%.
- children
Content, or a function of the part's state that returns it.
Type ReactNode | ((state: ProgressValueState) => ReactNode)
- className
Class names, or a function of the part's state that returns them.
Type string | ((state: ProgressValueState) => string)
- render
Renders your own element: one that receives the part's props, or a function of the props and the state.
Type RenderProp<ProgressValueState>
- style
Styles, or a function of the part's state that returns them.
Type CSSProperties | ((state: ProgressValueState) => CSSProperties)