Raxol.UI.Components.Input.SelectList (Raxol v0.2.0)

View Source

A component that allows users to select an option from a list.

Allows single or multiple selections.

  • Supports scrolling for long lists.

Summary

Types

option()

@type option() :: {String.t(), any()}

options()

@type options() :: [option()]

props()

@type props() :: %{
  optional(:id) => String.t(),
  :options => options(),
  optional(:label) => String.t(),
  optional(:on_select) => (any() -> any()),
  optional(:on_cancel) => (-> any()) | nil,
  optional(:theme) => map(),
  optional(:max_height) => integer() | nil
}

state()

@type state() :: %{
  id: String.t() | nil,
  options: options(),
  label: String.t() | nil,
  on_select: (any() -> any()) | nil,
  on_cancel: (-> any()) | nil,
  theme: map() | nil,
  max_height: integer() | nil,
  focused_index: integer(),
  scroll_offset: integer()
}