TermUI.Widget.Progress (TermUI v0.2.0)

View Source

A widget for displaying progress bars and spinners.

Progress supports two modes:

  • Bar mode: Shows a filled bar proportional to progress value
  • Spinner mode: Shows an animated indicator for indeterminate progress

Usage

# Bar mode
Progress.render(%{value: 0.5}, state, area)

# With percentage
Progress.render(%{value: 0.75, show_percentage: true}, state, area)

# Spinner mode
Progress.render(%{mode: :spinner}, state, area)

Props

  • :value - Progress value 0.0 to 1.0 (default: 0.0)
  • :mode - :bar or :spinner (default: :bar)
  • :show_percentage - Show percentage text (default: false)
  • :filled_char - Character for filled portion (default: "█")
  • :empty_char - Character for empty portion (default: "░")
  • :style - Style options for the bar

Summary

Functions

Handles events for the progress widget.

Initializes the progress widget state.

Renders the progress indicator.

Functions

handle_event(arg1, state)

Handles events for the progress widget.

init(props)

Initializes the progress widget state.

render(state, area)

Renders the progress indicator.