List Item

By default, this will look up for:

  • $object->name as the main value.
  • $object->avatar as the picture url.

$users = App\Models\User::take(3)->get();
@foreach($users as $user)
<x-list-item :item="$user" link="/docs/installation" />

Slots and other attributes

You can override all slots. It also supports nested properties.

Port Evelynburgh

Custom value
Custom sub-value
$user1 = App\Models\User::inRandomOrder()->first();
$user2 = App\Models\User::inRandomOrder()->first();
{{-- Notice ``. It supports nested properties --}}
<x-list-item :item="$user1" value="other_name" sub-value="" avatar="other_avatar" />
{{-- All slots --}}
<x-list-item :item="$user2" no-separator no-hover>
<x-badge value="top user" class="badge-primary" />
Custom value
Custom sub-value
<x-button icon="o-trash" class="text-red-500" wire:click="delete(1)" spinner />