Skip to content

ProgressBar ​

A linear progress indicator. Pass progress as a 0..1 value for determinate fill, or leave it null for an indeterminate sliding segment. tone sets the fill color, overridden by an explicit color.

Import ​

kotlin
import io.github.heartcoolman.prism.ui.PrismProgressBar

Basic usage ​

kotlin
PrismProgressBar(progress = 0.6f)

Indeterminate ​

Omit progress (or pass null) for an indeterminate bar.

kotlin
PrismProgressBar()

Tones ​

kotlin
PrismProgressBar(progress = 0.4f, tone = PrismTone.Accent)
PrismProgressBar(progress = 0.8f, tone = PrismTone.Success)
PrismProgressBar(progress = 0.3f, tone = PrismTone.Danger)

API ​

ParameterTypeDefaultDescription
modifierModifierModifierLayout/visual modifier (the bar fills max width).
progressFloat?nullnull → indeterminate; otherwise a 0..1 value (coerced into range).
tonePrismTonePrismTone.AccentSemantic fill color: Accent, Success, Warning, Danger, Neutral.
colorColortone.color()Fill color; overrides the color derived from tone.

Enum ​

kotlin
enum class PrismTone { Accent, Success, Warning, Danger, Neutral }

All components assume an enclosing PrismTheme { }. See Styling for theming details.

Released under the MIT License.