PureAdmin.Components.List (PureAdmin v1.1.0)

Copy Markdown View Source

List components for Pure Admin.

Provides basic HTML lists (basic_list/1, ordered_list/1, definition_list/1) and complex structured lists (list/1, list_item/1).

Summary

Functions

Renders a styled unordered list.

Renders a styled definition list.

Renders a styled list container.

Renders a list item with optional structured content.

Renders a styled ordered list.

Functions

basic_list(assigns)

Renders a styled unordered list.

Examples

<.basic_list>
  <li>Item one</li>
  <li>Item two</li>
</.basic_list>

<.basic_list spacing="compact" has_icon icon_variant="danger">
  <li>Error one</li>
  <li>Error two</li>
</.basic_list>

Attributes

  • spacing (:string) - Defaults to nil.Must be one of nil, "compact", or "spacious".
  • is_unstyled (:boolean) - Remove bullets and padding. Defaults to false.
  • is_inline (:boolean) - Display items inline (horizontal). Defaults to false.
  • is_bordered (:boolean) - Add borders between items. Defaults to false.
  • is_striped (:boolean) - Zebra striping on even rows. Defaults to false.
  • has_icon (:boolean) - Show icons (checkmarks by default). Defaults to false.
  • icon_variant (:string) - Icon variant (when has_icon is true). Defaults to "success". Must be one of "success", "danger", "info", or "warning".
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

definition_list(assigns)

Renders a styled definition list.

Examples

<.definition_list>
  <dt>Term</dt>
  <dd>Definition</dd>
</.definition_list>

<.definition_list is_inline>
  <dt>Status</dt>
  <dd>Active</dd>
</.definition_list>

Attributes

  • is_inline (:boolean) - Horizontal key-value layout. Defaults to false.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

list(assigns)

Renders a styled list container.

Attributes

  • is_bordered (:boolean) - Add borders between items. Defaults to false.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

list_item(assigns)

Renders a list item with optional structured content.

Examples

<.list_item title_text="John Doe" subtitle_text="Developer" meta_text="Online" />

<.list_item title_text="Jane Smith" subtitle_text="Designer">
  <:avatar><img src="/avatars/jane.jpg" /></:avatar>
</.list_item>

<.list_item>
  Custom content here
</.list_item>

Attributes

  • title_text (:string) - Title text. Defaults to nil.
  • subtitle_text (:string) - Subtitle text. Defaults to nil.
  • meta_text (:string) - Meta text (right side). Defaults to nil.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • avatar - Avatar content.
  • meta - Rich meta content (right side, overrides meta_text).
  • inner_block - Custom content (overrides title/subtitle/meta).

ordered_list(assigns)

Renders a styled ordered list.

Examples

<.ordered_list>
  <li>Step one</li>
  <li>Step two</li>
</.ordered_list>

<.ordered_list style="roman">
  <li>Chapter I</li>
  <li>Chapter II</li>
</.ordered_list>

Attributes

  • style (:string) - Defaults to nil.Must be one of nil, "roman", or "alpha".
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)