Phoenix LiveView Library

Real-time
DataTables

Build powerful, scalable data tables with sorting, filtering, bulk actions, and updates that reach every open window.

Orders, right now
Open the live demo

A real LiveTable. New orders arrive and change while you watch.

Order Customer Amount Status
#25063 Sneha Rathore ₹10,612 new
#12787 Rohan Roy ₹2,397 new
#46783 Uma Banerjee ₹20,358 shipped
#88087 Urmi Venkatesh ₹10,236 new
#81459 Naresh Jain ₹1,826 shipped
#34721 Shruti Naidu ₹20,358 new
Features

Everything You Need

Production-ready features that work out of the box.

Real-time Rows

Subscribe in mount and broadcast where your data changes. Every open table updates in place, and only the rows that changed are sent to the browser.

PubSub Changed rows only No polling

Smart Filters

Toggles, ranges, selects with search-as-you-type, and query transformers. All in the URL.

Bulk Actions

Select rows, or every row matching the filters. Your handler gets one Ecto query.

Ecto Joins

Sort, search and filter across associations and computed columns.

CSV & PDF Export

Exactly what's filtered, streamed straight to the browser. No job queue.

Your Components

Cells, cards, controls and empty states are yours. The storefront is a table too.

Built for Performance

Sorting, filtering and pagination run in the database, so a million rows page as quickly as a hundred.

DB-level pagination 1M-row demo
Delightful DX

Minimal Code, Maximum Power

A searchable, filterable, paginated table that stays in sync across every window.

lib/my_app_web/live/orders_live.ex
defmodule MyAppWeb.OrdersLive do
  use MyAppWeb, :live_view
  use LiveTable.LiveResource, schema: MyApp.Order

  def mount(_params, _session, socket) do
    # Rows update in every open window when you call LiveTable.broadcast/3.
    {:ok, LiveTable.subscribe(socket, MyApp.PubSub, "orders")}
  end

  def fields do
    [
      number: %{label: "Order", searchable: true},
      customer: %{label: "Customer", sortable: true, searchable: true},
      amount: %{label: "Amount", sortable: true},
      status: %{label: "Status"}
    ]
  end

  def filters do
    [
      big: Boolean.new(:amount, "big", %{
        label: "Big orders",
        condition: dynamic([o], o.amount > 10_000)
      })
    ]
  end

  def render(assigns) do
    ~H"""
    <.live_table fields={fields()} filters={filters()} options={@options} streams={@streams} />
    """
  end
end

Ready to build powerful tables?

Add LiveTable to your Phoenix project in minutes.

{:live_table, "~> 0.5.0"}