LiveFilter.Components.SearchSelect (LiveFilter v0.1.0)

View Source

A search-enabled select component with single and multi-select support.

Features:

  • In-dropdown search filtering
  • Single or multi-select modes
  • Configurable display of selected values
  • Item count badges
  • Clear all functionality
  • Keyboard navigation

Summary

Functions

Renders a search-enabled select dropdown.

Functions

search_select(assigns)

Renders a search-enabled select dropdown.

Options Format

Options should be a list of tuples: [{value, label}, ...] or [{value, label, count}, ...]

Examples

<.search_select
  id="status-filter"
  options={[
    {:pending, "Pending", 12},
    {:in_progress, "In Progress", 8},
    {:completed, "Completed", 45}
  ]}
  selected={[:pending, :in_progress]}
  on_change="update_status_filter"
/>

Attributes

  • id (:string) (required)
  • options (:list) (required)
  • selected (:list) - Defaults to [].
  • on_change (:any) (required)
  • multiple (:boolean) - Defaults to true.
  • placeholder (:string) - Defaults to "Select...".
  • display_count (:integer) - Defaults to 3.
  • searchable (:boolean) - Defaults to true.
  • clearable (:boolean) - Defaults to true.
  • label (:string) - Defaults to nil.
  • icon (:string) - Defaults to nil.
  • class (:string) - Defaults to nil.
  • size (:string) - Defaults to "sm". Must be one of "sm", "md", or "lg".
  • show_label_in_selection (:boolean) - Defaults to false.
  • clear_icon (:string) - Defaults to "hero-x-circle".
  • plus_icon (:string) - Defaults to "hero-plus-circle".