LiveFilter.Components.AsyncSelect (LiveFilter v0.1.8)

Copy Markdown View Source

Dropdown async select component with server-side search.

Renders a search input and results dropdown where options are fetched from the server via search_fn callbacks on the FilterConfig.

Required Assigns

  • filter - The Filter struct containing value and config
  • myself - The parent LiveComponent's @myself for event targeting

Optional Assigns

  • async_search_text - Map of filter_id => search string
  • async_options - Map of filter_id => list of {value, label} tuples

Events (handled by parent)

  • async_search - %{"id" => filter_id, "value" => search_text}
  • async_select_option - %{"id" => filter_id, "value" => value, "label" => label}

Summary

Functions

render(assigns)

Attributes

  • filter (:map) (required) - The Filter struct.
  • myself (:any) (required) - The parent LiveComponent's @myself.
  • async_search_text (:map) - Map of filter_id => search string. Defaults to %{}.
  • async_options (:map) - Map of filter_id => [{value, label}]. Defaults to %{}.