PhoenixKitWarehouse.Web.Components.FilterChips (PhoenixKitWarehouse v0.1.0)

Copy Markdown View Source

Inline filter input components rendered in a list LiveView's toolbar, one per active filter. Each chip:

  • sends set_filter_value (%{"column_id" => id, "value" => value}) on change, debounced for :text;
  • sends clear_filter (%{"column_id" => id}) when the ✕ button is hit;
  • renders a per-filter_type input (:text / :enum / :numeric_range / :date_range).

All chips are rendered inside their own <form phx-change="set_filter_value"> with a hidden column_id input so the host LiveView's handle_event always receives both the id and the value.

Summary

Functions

filter_chip(assigns)

Attributes

  • meta (:map) (required) - Column metadata from ColumnConfig.
  • value (:any) - Current filter value (any shape). Defaults to nil.
  • entries (:list) - Visible entries — for dynamic enum options. Defaults to [].