defmodule PyrauiWeb.DocsLive.TableDocs do use PyrauiWeb, :html def render(assigns) do team_rows = [ %{ name: "Lena Moore", title: "Product Manager", location: "Berlin, DE", status: "Active", email: "lena@pyraui.dev" }, %{ name: "Marcus Reed", title: "Design Lead", location: "Austin, US", status: "Onboarding", email: "marcus@pyraui.dev" }, %{ name: "Aiko Fujita", title: "Senior Engineer", location: "Tokyo, JP", status: "Active", email: "aiko@pyraui.dev" }, %{ name: "Gabriel Khan", title: "Data Scientist", location: "Singapore", status: "Out of office", email: "gabriel@pyraui.dev" } ] metrics_rows = [ %{service: "Realtime", sla: "99.95%", incidents: 1, trend: "+0.3%"}, %{service: "Auth", sla: "99.99%", incidents: 0, trend: "+0.1%"}, %{service: "Billing", sla: "99.70%", incidents: 3, trend: "-0.4%"}, %{service: "Storage", sla: "99.80%", incidents: 2, trend: "-0.2%"} ] billing_rows = [ %{ customer: %{name: "Zeno Analytics", avatar: "ZA"}, plan: "Enterprise", mrr: "$12,400", renewal: "Apr 18", health: :good }, %{ customer: %{name: "Northwind Labs", avatar: "NL"}, plan: "Growth", mrr: "$4,120", renewal: "May 3", health: :watch }, %{ customer: %{name: "Arcade", avatar: "AR"}, plan: "Startup", mrr: "$1,640", renewal: "Jun 12", health: :risk } ] assigns = assigns |> assign(:team_rows, team_rows) |> assign(:metrics_rows, metrics_rows) |> assign(:billing_rows, billing_rows) ~H"""
Responsive data tables with density, striping, and variant options. Use slots to compose rich cells with avatars, badges, and inline actions.
An elevated table with relaxed spacing—ideal for team directories and account overviews.
Outlined variant with compact density and zebra striping—great for operational metrics.
Compose cells with avatars, badges, and CTA buttons while keeping the layout minimal.
<.table rows={@rows} variant={:outlined} density={:compact} striped>
<:col label="Service" field={:service} />
<:col label="Trend" align={:right} :let={row}>
<span class={trend_class(row.trend)}>{row.trend}</span>
</:col>
</.table>