Raxol.UI.Components.Display.Progress (Raxol v0.3.0)

View Source

A progress bar component for displaying completion status.

Features:

  • Customizable colors (harmonized style/theme prop merging)
  • Percentage display option
  • Custom width
  • Animated progress
  • Optional label
  • Accessibility/extra props (aria_label, tooltip, etc)
  • Robust lifecycle hooks (mount/unmount)

Summary

Functions

Initializes the progress bar state from props.

Mounts the progress bar (for future extensibility: timers, subscriptions, etc).

Unmounts the progress bar (cleanup for future extensibility).

Types

props()

@type props() :: %{
  optional(:id) => String.t(),
  optional(:progress) => float(),
  optional(:width) => integer(),
  optional(:show_percentage) => boolean(),
  optional(:label) => String.t(),
  optional(:theme) => map(),
  optional(:style) => map(),
  optional(:animated) => boolean(),
  optional(:aria_label) => String.t(),
  optional(:tooltip) => String.t()
}

state()

@type state() :: %{
  id: String.t() | nil,
  progress: float(),
  width: integer(),
  show_percentage: boolean(),
  label: String.t() | nil,
  theme: map() | nil,
  style: map() | nil,
  animated: boolean(),
  animation_frame: integer(),
  last_update: integer(),
  aria_label: String.t() | nil,
  tooltip: String.t() | nil
}

Functions

init(props)

Initializes the progress bar state from props.

mount(state)

Mounts the progress bar (for future extensibility: timers, subscriptions, etc).

unmount(state)

Unmounts the progress bar (cleanup for future extensibility).