Cinder (Cinder v0.18.1)

Copy Markdown View Source

Tables, lists and grids of Ash resources in Phoenix LiveView, with filtering, sorting, search and pagination.

<Cinder.collection 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>
</Cinder.collection>

For a list or grid, describe each item with an <:item> slot:

<Cinder.collection resource={MyApp.User} actor={@current_user} layout={:grid}>
  <:col field="name" filter sort />
  <:item :let={user}>
    <div class="p-4 border rounded">{user.name}</div>
  </:item>
</Cinder.collection>

This module holds the component, collection/1 (see Cinder.Collection for its attributes), and functions for changing a collection from your LiveView:

See the Getting Started guide to begin, and Custom Filters to write your own filter types.

Summary

Functions

collection(assigns)

See Cinder.Collection.collection/1.

refresh_table(socket, table_id)

See Cinder.Refresh.refresh_table/2.

refresh_table(socket, table_id, opts)

See Cinder.Refresh.refresh_table/3.

refresh_tables(socket, table_ids)

See Cinder.Refresh.refresh_tables/2.

refresh_tables(socket, table_ids, opts)

See Cinder.Refresh.refresh_tables/3.

remove_item(socket, collection_id, id)

See Cinder.Update.remove_item/3.

remove_items(socket, collection_id, ids)

See Cinder.Update.remove_items/3.

update_if_visible(socket, collection_id, id, update_fn)

See Cinder.Update.update_if_visible/4.

update_item(socket, collection_id, id, update_fn)

See Cinder.Update.update_item/4.

update_items(socket, collection_id, ids, update_fn)

See Cinder.Update.update_items/4.

update_items_if_visible(socket, collection_id, ids, update_fn)

See Cinder.Update.update_items_if_visible/4.