Shared table shell per design spec §5 — search, sort, pagination, loading/empty/error states. All state (search query, current page, sort column) is owned by the parent LiveView and passed in as assigns; this component only renders and emits events.
Supports two row-data modes:
rows— a plain list, fully re-rendered each updatestream— a Phoenix.LiveView.LiveStream, for high-volume or continuously-updating lists (see spec §6) Exactly one ofrows/streamshould be passed.
Summary
Functions
Attributes
id(:string) (required)rows(:list) - Defaults to[].stream(:any) - Defaults tonil.row_id(:any) - Defaults tonil.page(:integer) - Defaults tonil.total_pages(:integer) - Defaults tonil.total_count(:integer) - Defaults tonil.search(:string) - Defaults to"".search_placeholder(:string) - Defaults to"Search…".show_search(:boolean) - Defaults totrue.loading(:boolean) - Defaults tofalse.error(:string) - Defaults tonil.empty_title(:string) - Defaults to"No data".empty_message(:string) - Defaults to"Nothing to show yet.".sort_field(:string) - Defaults tonil.sort_dir(:string) - Defaults to"desc".compact(:boolean) - Defaults tofalse.
Slots
col(required) - Accepts attributes:label(:string) (required)sortable(:boolean)field(:string)