Table component for displaying data in a traditional HTML table layout.
DEPRECATED: Use Cinder.collection instead. This module will be removed in version 1.0.
<!-- Use this instead -->
<Cinder.collection resource={MyApp.User} actor={@current_user}>
<:col :let={user} field="name" filter sort>{user.name}</:col>
</Cinder.collection>See the Upgrading Guide for migration instructions.
Basic Usage
<Cinder.Table.table resource={MyApp.User} actor={@current_user}>
<:col :let={user} field="name" filter sort>{user.name}</:col>
<:col :let={user} field="email" filter>{user.email}</:col>
<:col :let={user} field="created_at" sort>{user.created_at}</:col>
</Cinder.Table.table>With Query
<Cinder.Table.table query={MyApp.User |> Ash.Query.filter(active: true)} actor={@current_user}>
<:col :let={user} field="name" filter sort>{user.name}</:col>
<:col :let={user} field="email" filter>{user.email}</:col>
</Cinder.Table.table>See Also
Cinder.collection/1- Unified collection component supporting table, list, and grid layoutsCinder.Collection- Full documentation for all collection features
Summary
Functions
table(assigns)
deprecated
Renders a data table.
Functions
This function is deprecated. Use Cinder.collection/1 instead.
Renders a data table.
DEPRECATED: Use Cinder.collection instead.
This is equivalent to calling Cinder.collection with layout={:table}.
Attributes
resource(:atom) - The Ash resource to query. Defaults tonil.query(:any) - The Ash query to execute. Defaults tonil.actor(:any) - Actor for authorization. Defaults tonil.tenant(:any) - Tenant for multi-tenant resources. Defaults tonil.scope(:any) - Ash scope containing actor and tenant. Defaults tonil.id(:string) - Unique identifier for the table. Defaults to"cinder-table".page_size(:any) - Number of items per page. Defaults to25.theme(:any) - Theme name or theme map. Defaults to"default".url_state(:any) - URL state object from UrlSync.handle_params. Defaults tofalse.query_opts(:list) - Additional Ash query options. Defaults to[].initial_load(:any) - :async (default) or :sync, which puts the first page of data in the server-rendered HTML. SeeCinder.Collection. Defaults tonil.on_state_change(:any) - Custom state change handler. Defaults tonil.on_query_change(:any) - Event name sent to parent when the query changes. Parent receives {event_name, %{query: Ash.Query.t(), count: integer() | nil, id: string()}}. Defaults tonil.show_pagination(:boolean) - Whether to show pagination controls. Defaults totrue.show_filters(:boolean) - Whether to show filter controls. Defaults tonil.loading_message(:string) - Message to show while loading. Defaults tonil.filters_label(:string) - Label for the filters component. Defaults tonil.search(:any) - Search configuration. Defaults tonil.empty_message(:string) - Message when no results. Defaults tonil.error_message(:string) - Message to show on error. Defaults tonil.class(:string) - Additional CSS classes. Defaults to"".row_click(:any) - Function to call when a row is clicked. Defaults tonil.item_class(:any) - CSS class(es) for each row. A string, or afn item -> class endfunction evaluated per row, appended to the theme's row class. Defaults tonil.
Slots
col- Accepts attributes:field(:string)filter(:any)filter_options(:list)sort(:any)search(:boolean)label(:string)class(:string)
filter- Accepts attributes:field(:string)filter(:any)label(:string)
loading- Custom loading state content.empty- Custom empty state content.error- Custom error state content.