CardListBuilder
Selkie::UI::CardListBuilder
Builder for a card list widget ā a vertically scrollable list of items with configurable heights and optional borders.
Methods
add-item($widget, :$height!, :$root, :$border)
Adds a widget as a card item. :$height is required (in rows).
:$root defaults to $*UI-PARENT. :$border adds an optional border.
add-item(&block, :$height!, :$root, :$border)
Reactive variant ā block is re-evaluated when subscribed state changes.
set-items(@items) / set-items(&block)
Replaces all items. Each item is a hash with :widget, :root, :height,
and optional :border. The block variant supports reactive subscriptions.
clear-items
Removes all items.
set-item-height(Int $idx, Int $height) / set-item-height(&block)
Changes the height of the item at $idx. Block variant supports reactive
subscriptions and receives ($builder) returning (:$idx, :$height).
select-index(Int $idx) / select-index(&block)
Selects the item at $idx (0-based). The block variant supports reactive
subscriptions.
select-first(Bool $select-first = True) / select-first(&block)
Selects the first item when True. Block variant supports reactive
subscriptions.
select-last(Bool $select-last = True) / select-last(&block)
Selects the last item when True. Block variant supports reactive
subscriptions.
scroll-up / scroll-down
Scrolls the card list by one item.
on-select(&block) (idempotent)
Registers a callback for selection changes. Receives ($builder, $idx).