Defer loading on a widget

Following livewire's docs I don't seem to be able to get this working, has anyone had success deferring loading on a widget?

class MyWidget extends BaseWidget
{
    public bool $readyToLoad = false;

    public function loadData()
    {
        $this->readyToLoad = true;
    }

    protected function getStats(): array
    {
        if (! $this->readyToLoad) {
            return [
                Stat::make('Loading', 'Loading...')
            ];
        }

        sleep (5);

        return [
            Stat::make('Loaded Widget', 'Done!'),
        ];
    }
}
Solution
$isLazy = true;

public function placeholder(): View
{
    return view('loading');
}


<!-- resources/views/loading.blade.php -->
<div>loading..</div>
Was this page helpful?
Defer loading on a widget - Filament