© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•16mo ago•
1 reply
taz

Failed to lazy load a column in a table

I have a custom column that lazy load a livewire component. But it still wait 7 seconds before seeing the table appear on screen. Have you ever lazy load a column in a FIlament table ?
<?php

namespace App\Tables\Columns;

use Filament\Tables\Columns\Column;

class ModelStatusColumn extends Column
{
    protected string $view = 'tables.columns.model-status-column';
}
<?php

namespace App\Tables\Columns;

use Filament\Tables\Columns\Column;

class ModelStatusColumn extends Column
{
    protected string $view = 'tables.columns.model-status-column';
}


and its view lazy loads a livewire component
<div>
    <livewire:model-status-livewire-component lazy :record="$getRecord()"  />
</div>
<div>
    <livewire:model-status-livewire-component lazy :record="$getRecord()"  />
</div>


Livewire component lazy loaded

<?php

namespace App\Livewire;

use Livewire\Component;
use Livewire\Attributes\Lazy;

#[Lazy]
class ModelStatusLivewireComponent extends Component
{
    public $record;

    public ?string $longAttributeToCompute = null;

    public function mount($record)
    {
        $this->record = $record;
        sleep(7);  // Simulate a 5 to 7 seconds long api call that will do a compute based on some record attributes
        $this->longAttributeToCompute = $record->name;
       
    }

    public function render()
    {
        return view('livewire.model-status-livewire-component');
    }
}
<?php

namespace App\Livewire;

use Livewire\Component;
use Livewire\Attributes\Lazy;

#[Lazy]
class ModelStatusLivewireComponent extends Component
{
    public $record;

    public ?string $longAttributeToCompute = null;

    public function mount($record)
    {
        $this->record = $record;
        sleep(7);  // Simulate a 5 to 7 seconds long api call that will do a compute based on some record attributes
        $this->longAttributeToCompute = $record->name;
       
    }

    public function render()
    {
        return view('livewire.model-status-livewire-component');
    }
}

<div class="px-4 py-3 text-white font-bold">
    {{ $longAttributeToCompute }}
</div>
<div class="px-4 py-3 text-white font-bold">
    {{ $longAttributeToCompute }}
</div>
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Lazy load table column
FilamentFFilament / ❓┊help
16mo ago
Lazy load a custom column in a table
FilamentFFilament / ❓┊help
16mo ago
Radical lazy/defer load on collapsible column.
FilamentFFilament / ❓┊help
3y ago
lazy loading in Table
FilamentFFilament / ❓┊help
3y ago