Raxol.UI.Components.Selection.List (Raxol v0.5.0)
View SourceA component for displaying a selectable list of items.
Summary
Functions
Handles events for the List component, such as keyboard and mouse input.
Initializes the List component state from props.
Callback implementation for Raxol.UI.Components.Base.Component.mount/1
.
Renders the List component, displaying visible items.
Callback implementation for Raxol.UI.Components.Base.Component.unmount/1
.
Updates the List component state in response to messages.
Types
@type t() :: %Raxol.UI.Components.Selection.List{ focused: boolean(), height: non_neg_integer(), id: any(), item_renderer: (any() -> any()) | nil, items: list(), on_select: (any() -> any()) | nil, scroll_offset: non_neg_integer(), selected_index: non_neg_integer(), style: map(), width: non_neg_integer() }
State for the Selection.List component.
- :id - unique identifier
- :items - list of items
- :selected_index - index of selected item
- :scroll_offset - scroll offset
- :width - component width
- :height - component height
- :style - style map
- :focused - whether the list is focused
- :on_select - callback for selection
- :item_renderer - function to render items
Functions
Handles events for the List component, such as keyboard and mouse input.
Initializes the List component state from props.
Callback implementation for Raxol.UI.Components.Base.Component.mount/1
.
Renders the List component, displaying visible items.
Callback implementation for Raxol.UI.Components.Base.Component.unmount/1
.
Updates the List component state in response to messages.