Progress bar -- displays progress within a range.
Props
range(list) --[min, max]as a two-element list. Default:[0, 100].value(number) -- current progress value. Default: 0.width(length) -- bar width. Default: fill. SeeToddy.Iced.Length.height(length) -- bar height. Default: shrink.style-- named preset atom (:primary(default),:secondary,:success,:danger,:warning) orStyleMap.t()for custom styling. SeeToddy.Iced.StyleMap.vertical(boolean) -- whentrue, renders the progress bar vertically.a11y(map) -- accessibility overrides. SeeToddy.Iced.A11y.
Summary
Functions
Sets accessibility annotations.
Converts this progress bar struct to a ui_node() map via the Toddy.Iced.Widget protocol.
Sets the progress bar height.
Creates a new progress bar struct with the given range, value, and optional keyword opts.
Sets the progress bar style.
Renders the progress bar vertically.
Sets the progress bar width.
Applies keyword options to an existing progress bar struct.
Types
@type option() :: {:width, Toddy.Iced.Length.t()} | {:height, Toddy.Iced.Length.t()} | {:style, style()} | {:vertical, boolean()} | {:a11y, Toddy.Iced.A11y.t()}
@type preset() :: :warning | :danger | :success | :secondary | :primary
@type style() :: preset() | Toddy.Iced.StyleMap.t()
@type t() :: %Toddy.Iced.Widget.ProgressBar{ a11y: Toddy.Iced.A11y.t() | nil, height: Toddy.Iced.Length.t() | nil, id: String.t(), range: {number(), number()}, style: style() | nil, value: number(), vertical: boolean() | nil, width: Toddy.Iced.Length.t() | nil }
Functions
@spec a11y(progress_bar :: t(), a11y :: Toddy.Iced.A11y.t()) :: t()
Sets accessibility annotations.
@spec build(progress_bar :: t()) :: Toddy.Iced.ui_node()
Converts this progress bar struct to a ui_node() map via the Toddy.Iced.Widget protocol.
@spec height(progress_bar :: t(), height :: Toddy.Iced.Length.t()) :: t()
Sets the progress bar height.
@spec new( id :: String.t(), range :: {number(), number()}, value :: number(), opts :: [option()] ) :: t()
Creates a new progress bar struct with the given range, value, and optional keyword opts.
Sets the progress bar style.
Renders the progress bar vertically.
@spec width(progress_bar :: t(), width :: Toddy.Iced.Length.t()) :: t()
Sets the progress bar width.
Applies keyword options to an existing progress bar struct.