List

A lightweight display list for rendering dynamic items. Items are plain containers with no visual frame by default — add your own padding and layout inside the html payload. For drag-to-reorder behaviour, use the Reorderable component instead.

Basic List

Items can be updated, added, or removed via the JS API without a page reload.

Review pull requests
Deploy staging build
Fix login redirect bug
Update documentation
Interact to see output...
PHP

PHP PHP Methods (Fluent)

Method / PropertyParametersDescription
$m->list($id)stringCreate a list component.
->items($items)arraySet list items. Each: {key, html, id?, class?, attrs?}.
->emptyMessage($msg)?stringMessage shown when the list has no items.

JS JS Methods

Method / PropertyParametersDescription
m.list(id, opts)string, ?objectGet or create list instance.
addItem(key, html, opts)string, string, ?objectAppend a new item.
upsertItem(key, html, opts)string, string, ?objectUpdate existing item or insert if not found.
removeItem(key)stringRemove an item by key.
clear()Remove all items.
count()Returns number of items.
getItems()Returns array of item DOM elements.
getOrder()Returns array of item keys in current order.
refresh(url, opts)string, ?objectFetch item HTML from URL and replace list contents (returns Promise).

EVENT Events

Event NameDetailDescription
m:list:refresh{id, items}Fired after content is refreshed from a URL.
m:list:refresh:error{id, error}Fired if content refresh fails.