Progress bar component.
Usage: (def my-progress (progress-bar :width 40))
;; Update progress (0.0 to 1.0): (set-progress my-progress 0.5)
;; In view function: (progress-view my-progress)
Progress bar component. Usage: (def my-progress (progress-bar :width 40)) ;; Update progress (0.0 to 1.0): (set-progress my-progress 0.5) ;; In view function: (progress-view my-progress)
(complete? bar)Check if progress is complete (100%).
Check if progress is complete (100%).
(decrement bar)(decrement bar amount)Decrement progress by amount (default 0.01).
Decrement progress by amount (default 0.01).
(increment bar)(increment bar amount)Increment progress by amount (default 0.01).
Increment progress by amount (default 0.01).
(percent bar)Get current progress as 0.0-1.0.
Get current progress as 0.0-1.0.
(percent-int bar)Get current progress as 0-100 integer.
Get current progress as 0-100 integer.
(progress-bar &
{:keys [width percent bar-style show-percent full-style
empty-style percent-style id]
:or {width 40
percent 0.0
bar-style :default
show-percent false
id (rand-int 1000000)}})Create a progress bar component.
Options: :width - Total width in characters (default 40) :percent - Initial progress 0.0-1.0 (default 0) :bar-style - Keyword from bar-styles or custom map (default :default) :show-percent - Show percentage text (default false) :full-style - Style for filled portion :empty-style - Style for empty portion :percent-style - Style for percentage text :id - Unique ID
Create a progress bar component. Options: :width - Total width in characters (default 40) :percent - Initial progress 0.0-1.0 (default 0) :bar-style - Keyword from bar-styles or custom map (default :default) :show-percent - Show percentage text (default false) :full-style - Style for filled portion :empty-style - Style for empty portion :percent-style - Style for percentage text :id - Unique ID
(progress-init bar)Initialize progress bar, returns [bar cmd].
Initialize progress bar, returns [bar cmd].
(progress-update bar _msg)Update progress bar state. Progress bars are typically updated directly via set-progress rather than through messages. Returns [bar nil].
Update progress bar state. Progress bars are typically updated directly via set-progress rather than through messages. Returns [bar nil].
(progress-view bar)Render the progress bar to a string.
Render the progress bar to a string.
(set-progress bar p)Set progress (0.0 to 1.0).
Set progress (0.0 to 1.0).
(set-progress-int bar p)Set progress as 0-100 integer.
Set progress as 0-100 integer.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |