© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
Rupadana

How to use ViewComponent Class

I've write some livewire class using
php artisan make:livewire HeroSection
php artisan make:livewire HeroSection


than, i include it to other livewire components like this

<div>
    @vite('resources/css/filament/rupadana/theme.css')

    @include('livewire.components.header')
    <main class="space-y-40 mb-40">
        @livewire(App\Livewire\HeroSection::class)
        
    </main>

    @include('livewire.components.footer')
</div>
<div>
    @vite('resources/css/filament/rupadana/theme.css')

    @include('livewire.components.header')
    <main class="space-y-40 mb-40">
        @livewire(App\Livewire\HeroSection::class)
        
    </main>

    @include('livewire.components.footer')
</div>


its work, and im start to extends ViewComponent Class

<?php

namespace App\Livewire;

use Filament\Support\Components\ViewComponent;

class HeroSection extends ViewComponent
{

    protected string $view = "livewire.components.hero-section";
}
<?php

namespace App\Livewire;

use Filament\Support\Components\ViewComponent;

class HeroSection extends ViewComponent
{

    protected string $view = "livewire.components.hero-section";
}


and now the problem begin, its throw an error
Unable to find component: [App\Livewire\HeroSection]
Unable to find component: [App\Livewire\HeroSection]


why is this happening?
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

dynamic Use $class;
FilamentFFilament / ❓┊help
3y ago
Use of unknown class: ..
FilamentFFilament / ❓┊help
2y ago
How to use filament Tailwind class in a custom page?
FilamentFFilament / ❓┊help
9mo ago