List
List component.
List, Customization Blocks
List Items, Customization Blocks
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>
#
Compact
NEW
An option to compress the padding and display the component compacted.
No items.
No items.
<x-list label="Default" :items="$tags" searchable /> <x-list label="Compact" :items="$tags" searchable compact />
#
Lazy
NEW
An option to renders rows on the client.
<!-- First slice of 20, the default --><x-list label="Tags" :items="$tags" searchable height="60" lazy /> <!-- First slice of 4 --><x-list label="Tags" :items="$tags" searchable height="60" lazy="4" />
The row markup is still the same component, so every soft customization of list.items reaches the lazy rows unchanged. Search still sees the whole dataset: the filter runs over the JSON array, not over the rendered rows.
height is required, and the interact slots are refused
#
Action Slot
NEW
An option to renders controls on the right of the row.
No items.
<x-list label="Environments"> <x-list.items name="general" caption="1 server"> <x-slot:action> <x-button sm wire:click="deploy('general')">Deploy</x-button> </x-slot:action> <x-slot:menu> <x-dropdown.items text="Edit" wire:click="edit('general')" /> <x-dropdown.items text="Delete" wire:click="delete('general')" /> </x-slot:menu> </x-list.items> <x-list.items name="production" caption="12 servers"> <x-slot:action> <x-button sm color="red" wire:click="deploy('production')">Deploy</x-button> </x-slot:action> </x-list.items></x-list>
#
Skeleton
NEW
An option to display a lazy loading skeleton indicator.
<!-- 4 items, the default --><x-list skeleton /> <!-- The label, the search bar and the item count are derived from the props --><x-list skeleton="6" searchable label="Tags" />
- x-list.items is an internal child component, it expects the parent x-list Alpine scope to be present. Using it standalone will fail with Alpine errors. Always wrap inside x-list .
- name is required on every row (slot or data-driven). An empty or missing name throws an InvalidArgumentException at render time.
- height is restricted to the tokens 40 , 60 , 80 and 96 , anything else throws.
- The per-row menu is rendered through an internal x-floating at z-40 so it sits below Dialog/Modal/Slide/Toast overlays at z-50 . Customize the panel via the menu.floating block on x-list.items , not via floating's own customization.