List
List component.
List, Customization Blocks
Example:
// AppServiceProvider, "boot" method. TallStackUi::customize() ->list() ->block('block', 'classes');
List Items, Customization Blocks
Example:
// AppServiceProvider, "boot" method. TallStackUi::customize() ->list('items') ->block('block', 'classes');
The list component is a card-shaped, action-oriented list for browsing or managing
collections of items. Each row displays a bold name
, an optional
inline caption
(or arbitrary Blade content), and an optional
ellipsis-vertical menu trigger that opens a per-row dropdown. Optional client-side
search filters rows by name and caption.
The component can be populated in two ways:
- slot composition (recommended for static lists or
@foreachwith rich per-row Blade) - data-driven via the
:itemsattribute
No items.
<x-list> <x-list.items name="general" caption="1 server" /> <x-list.items name="production" caption="12 servers" /> <x-list.items name="staging" caption="3 servers" /></x-list> <!-- or --> @php // `$items` may be an array, a Collection, or any object that implements // `Illuminate\Contracts\Support\Arrayable`. Each entry is read with // `data_get`, so accessors and array keys both work. The only required // key is `name` — every other key is optional and accessible inside // `@interact('item_menu', $item)` as `$item['extra_key']`. $items = [ ['name' => 'general', 'caption' => '1 server'], ['name' => 'production', 'caption' => '12 servers'], ['name' => 'staging', 'caption' => '3 servers'], ];@endphp <x-list :items="$items" />
No items.
<x-list label="Tags" hint="Manage your tags here."> <x-list.items name="general" caption="1 server" /> <x-list.items name="production" caption="12 servers" /></x-list>
An option to perform client-side filtering of rows.
No items.
<x-list label="Tags" searchable> <x-list.items name="general" caption="1 server" /> <x-list.items name="production" caption="12 servers" /> <x-list.items name="staging" caption="3 servers" /></x-list>
No items.
<x-list label="Tags" searchable search-placeholder="Filter tags by name or caption"> <x-list.items name="general" caption="1 server" /> <x-list.items name="production" caption="12 servers" /></x-list>
<x-list label="Tags" searchable> @foreach ($tags as $tag) <x-list.items :name="$tag->name" :caption="$tag->servers_count.' server(s)'"> <x-slot:menu> <x-dropdown.items text="Edit" wire:click="edit({{ $tag->id }})" /> <x-dropdown.items text="Delete" wire:click="delete({{ $tag->id }})" /> </x-slot:menu> </x-list.items> @endforeach</x-list>
No items.
@php $tags = [ ['name' => 'general', 'caption' => '1 server'], ['name' => 'production', 'caption' => '12 servers'], ['name' => 'staging', 'caption' => '3 servers'], ];@endphp <x-list label="Tags" :items="$tags" searchable />
<!-- The `height` attribute accepts one of `'40'`, `'60'`, `'80'` or `'96'`, which translate to `max-h-{n}` plus a custom-styled scrollbar.--><x-list label="Tags" :items="$tags" searchable height="60" />
No tags configured yet.
<!-- The empty slot is shown when the list has zero items AND when the search filter matches none. The default falls back to the `ts-ui::messages.list.empty` translation key. --><x-list label="Tags" searchable> <x-slot:empty> <div class="flex flex-col items-center gap-2 py-4"> <p class="text-sm text-secondary-700 dark:text-dark-100">No tags configured yet.</p> <x-button text="Create tag" wire:click="create" /> </div> </x-slot:empty> <x-list.items name="general" caption="1 server" /></x-list>
No items.
<x-list label="Features"> <x-list.items name="signup-flow"> <x-badge color="green" round xs>active</x-badge> </x-list.items> <x-list.items name="checkout-v2"> <x-badge color="amber" round xs>rolling out</x-badge> </x-list.items> <x-list.items name="legacy-onboarding"> <x-badge color="red" round xs>retired</x-badge> </x-list.items></x-list>
-
x-list.itemsis an internal child component, it expects the parentx-listAlpine scope to be present. Using it standalone will fail with Alpine errors. Always wrap insidex-list. -
nameis required on every row (slot or data-driven). An empty or missingnamethrows anInvalidArgumentExceptionat render time. -
heightis restricted to the tokens40,60,80and96, anything else throws. -
The per-row menu is rendered through an internal
x-floatingatz-40so it sits below Dialog/Modal/Slide/Toast overlays atz-50. Customize the panel via themenu.floatingblock onx-list.items, not via floating's own customization.