# `Toddy.Iced.Widget.ProgressBar`
[🔗](https://github.com/toddy-ui/toddy-elixir/blob/v0.3.0/lib/toddy/iced/widget/progress_bar.ex#L1)

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. See `Toddy.Iced.Length`.
- `height` (length) -- bar height. Default: shrink.
- `style` -- named preset atom (`:primary` (default), `:secondary`, `:success`,
  `:danger`, `:warning`) or `StyleMap.t()` for custom styling.
  See `Toddy.Iced.StyleMap`.
- `vertical` (boolean) -- when `true`, renders the progress bar vertically.
- `a11y` (map) -- accessibility overrides. See `Toddy.Iced.A11y`.

# `option`

```elixir
@type option() ::
  {:width, Toddy.Iced.Length.t()}
  | {:height, Toddy.Iced.Length.t()}
  | {:style, style()}
  | {:vertical, boolean()}
  | {:a11y, Toddy.Iced.A11y.t()}
```

# `preset`

```elixir
@type preset() :: :warning | :danger | :success | :secondary | :primary
```

# `style`

```elixir
@type style() :: preset() | Toddy.Iced.StyleMap.t()
```

# `t`

```elixir
@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
}
```

# `a11y`

```elixir
@spec a11y(progress_bar :: t(), a11y :: Toddy.Iced.A11y.t()) :: t()
```

Sets accessibility annotations.

# `build`

```elixir
@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.

# `height`

```elixir
@spec height(progress_bar :: t(), height :: Toddy.Iced.Length.t()) :: t()
```

Sets the progress bar height.

# `new`

```elixir
@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.

# `style`

```elixir
@spec style(progress_bar :: t(), style :: style()) :: t()
```

Sets the progress bar style.

# `vertical`

```elixir
@spec vertical(progress_bar :: t(), vertical :: boolean()) :: t()
```

Renders the progress bar vertically.

# `width`

```elixir
@spec width(progress_bar :: t(), width :: Toddy.Iced.Length.t()) :: t()
```

Sets the progress bar width.

# `with_options`

```elixir
@spec with_options(progress_bar :: t(), opts :: [option()]) :: t()
```

Applies keyword options to an existing progress bar struct.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
