PtahUi.Components.TableSearch (PtahUI v0.1.0)

Copy Markdown View Source

Search input that live-patches the URL with filter params compatible with Flop.

Renders as a Phoenix.LiveComponent so it can debounce internally.

Example

<.table_search id="users-search" params={@params} field={:name} path={~p"/users"} />

Summary

Functions

table_search(assigns)

Attributes

  • id (:string) (required)
  • params (:map) (required)
  • field (:atom) (required)
  • path (:string) (required)
  • placeholder (:string) - Defaults to "Pesquisar...".
  • class (:string) - Defaults to nil.
  • input_class (:string) - Full class string for the search input. Defaults to "block w-full sm:w-72 pl-9 pr-3 py-2 text-sm text-gray-900 bg-white border border-gray-300 rounded-lg placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent".
  • icon_class (:string) - Colour class for the magnifying-glass icon. Defaults to "text-gray-400".