PhoenixPaper.TableRow (PhoenixPaper v0.1.0)

Copy Markdown View Source

A row inside PhoenixPaper.TableHead/PhoenixPaper.TableBody/ PhoenixPaper.TableFooter (pp_table_row/1) — renders a <tr> with a hover highlight. See PhoenixPaper.Table's moduledoc for a full example.

selected renders a stronger, persistent highlight (e.g. for a checkbox- selected row) — pair it with a PhoenixPaper.Checkbox in the first PhoenixPaper.TableCell and your own phx-click/assign to track which rows are selected; that state isn't something this stateless component can own itself.

selected's background uses !bg-pp-primary/10 (the ! = Tailwind's important modifier), not a plain bg-pp-primary/10PhoenixPaper.TableBody's striped option sets its alternating background via a compound descendant selector ([&>tr:nth-child(even)]:...), which has higher CSS specificity than a bare class on the row itself, so a plain class here would silently lose to the stripe on every other row. !important wins regardless of specificity, so selected reliably wins over striped either way.

Summary

Functions

Renders a table row. See the module doc.

Functions

pp_table_row(assigns)

Renders a table row. See the module doc.

Attributes

  • paperize (:boolean) - Defaults to true.
  • selected (:boolean) - a stronger, persistent highlight. Defaults to false.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)