PhoenixPaper.List (PhoenixPaper v0.1.0)

Copy Markdown View Source

A Material Design list container (pp_list/1) — a vertical stack of PhoenixPaper.ListItems (and optionally PhoenixPaper.ListSubheader/ PhoenixPaper.Divider).

<.pp_list>
  <.pp_list_subheader>Main</.pp_list_subheader>
  <.pp_list_item navigate={~p"/"}>Home</.pp_list_item>
  <.pp_list_item navigate={~p"/inbox"}>Inbox</.pp_list_item>
  <.pp_divider />
  <.pp_list_subheader>Account</.pp_list_subheader>
  <.pp_list_item navigate={~p"/settings"}>Settings</.pp_list_item>
</.pp_list>

Renders role="list" on a <div> rather than <ul>/<li> so items are free to render as <a>, <button>, or <div> depending on their own attrs (see PhoenixPaper.ListItem) without fighting list-item content model rules.

Summary

Functions

Renders a list. See the module doc.

Functions

pp_list(assigns)

Renders a list. See the module doc.

Attributes

  • paperize (:boolean) - Defaults to true.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)