Raxol.UI.Components.Selection.Dropdown (Raxol v0.5.0)
View SourceA dropdown component that allows selecting one option from a list.
Summary
Functions
Handles key events for the Dropdown component, including toggling expansion and forwarding to the list.
Initializes the Dropdown component state from props.
Callback implementation for Raxol.UI.Components.Base.Component.mount/1
.
Renders the Dropdown component, showing either the expanded or collapsed state.
Callback implementation for Raxol.UI.Components.Base.Component.unmount/1
.
Updates the Dropdown component state in response to messages.
Types
@type t() :: %Raxol.UI.Components.Selection.Dropdown{ expanded: boolean(), focused: boolean(), id: any(), list_height: non_neg_integer(), list_state: any(), on_change: (any() -> any()) | nil, options: list(), selected_option: any(), style: map(), width: non_neg_integer() }
State for the Selection.Dropdown component.
- :id - unique identifier
- :options - list of options
- :selected_option - currently selected option
- :expanded - whether dropdown is expanded
- :width - dropdown width
- :list_height - height of the dropdown list
- :style - style map
- :focused - whether the dropdown is focused
- :on_change - callback for selection change
- :list_state - state of the nested list
Functions
Handles key events for the Dropdown component, including toggling expansion and forwarding to the list.
Initializes the Dropdown component state from props.
Callback implementation for Raxol.UI.Components.Base.Component.mount/1
.
Renders the Dropdown component, showing either the expanded or collapsed state.
Callback implementation for Raxol.UI.Components.Base.Component.unmount/1
.
Updates the Dropdown component state in response to messages.