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

Vertical slider -- vertical range input.

## Props

- `range` (list) -- `[min, max]` range as a two-element list. Default: `[0, 100]`.
- `value` (number) -- current slider value. Defaults to range minimum.
- `step` (number) -- step increment.
- `height` (length) -- slider height. Default: fill. See `Toddy.Iced.Length`.
- `default` (number) -- default value (double-click resets to this).
- `shift_step` (number) -- step increment when Shift is held.
- `rail_color` (hex color) -- color for the slider rail (both active and inactive portions).
- `rail_width` (number) -- rail thickness in pixels.
- `style` -- `:default` or `StyleMap.t()` for custom styling. See `Toddy.Iced.StyleMap`.
- `a11y` (map) -- accessibility overrides. See `Toddy.Iced.A11y`.

## Events

- `%Widget{type: :slide, id: id, value: value}` -- emitted continuously while dragging.
- `%Widget{type: :slide_release, id: id, value: value}` -- emitted when drag ends.

# `option`

```elixir
@type option() ::
  {:step, number()}
  | {:shift_step, number()}
  | {:default, number()}
  | {:width, Toddy.Iced.Length.t()}
  | {:height, Toddy.Iced.Length.t()}
  | {:rail_color, Toddy.Iced.Color.input()}
  | {:rail_width, number()}
  | {:style, style()}
  | {:a11y, Toddy.Iced.A11y.t()}
```

# `style`

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

# `t`

```elixir
@type t() :: %Toddy.Iced.Widget.VerticalSlider{
  a11y: Toddy.Iced.A11y.t() | nil,
  default: number() | nil,
  height: Toddy.Iced.Length.t() | nil,
  id: String.t(),
  rail_color: Toddy.Iced.Color.t() | nil,
  rail_width: number() | nil,
  range: {number(), number()},
  shift_step: number() | nil,
  step: number() | nil,
  style: style() | nil,
  value: number(),
  width: Toddy.Iced.Length.t() | nil
}
```

# `a11y`

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

Sets accessibility annotations.

# `build`

```elixir
@spec build(vertical_slider :: t()) :: Toddy.Iced.ui_node()
```

Converts this vertical slider struct to a `ui_node()` map via the `Toddy.Iced.Widget` protocol.

# `default`

```elixir
@spec default(vertical_slider :: t(), default :: number()) :: t()
```

Sets the default value (double-click resets to this).

# `height`

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

Sets the slider height.

# `new`

```elixir
@spec new(
  id :: String.t(),
  range :: {number(), number()},
  value :: number(),
  opts :: [option()]
) :: t()
```

Creates a new vertical slider struct with the given range, value, and optional keyword opts.

# `rail_color`

```elixir
@spec rail_color(vertical_slider :: t(), rail_color :: Toddy.Iced.Color.input()) ::
  t()
```

Sets the rail color.

# `rail_width`

```elixir
@spec rail_width(vertical_slider :: t(), rail_width :: number()) :: t()
```

Sets the rail width in pixels.

# `shift_step`

```elixir
@spec shift_step(vertical_slider :: t(), shift_step :: number()) :: t()
```

Sets the step increment when Shift is held.

# `step`

```elixir
@spec step(vertical_slider :: t(), step :: number()) :: t()
```

Sets the step increment.

# `style`

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

Sets the slider style.

# `width`

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

Sets the slider width.

# `with_options`

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

Applies keyword options to an existing vertical slider struct.

---

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