Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rubendn's avatar

Livewire Volt Full Page Component Exclude Layout

Is there a way to stop a Volt Full Page Component from inheriting any layout including the default or do I have to create a blank layout and use it in the component?

0 likes
5 replies
codingwithrk's avatar

Have you run this commend

php artisan volt:install

This commend will generate default layout page

1 like
rubendn's avatar

Yes, I'm already using Volt components with a layout page. What I want to do is use a Volt component that doesn't inherit any layout page.

1 like
codingwithrk's avatar

@rubendn Yeah, you can use it if you want the separate layout use the layout attribute or else you can directly mention that Volt Component name in route.php

1 like
rubendn's avatar

I ended up creating a blank layout and using the layout attribute.

1 like
ogi84's avatar

I was struggling with anonymous class and Attribute for the layout. This is what i found working

<?php

use Livewire\Attributes\Layout;
use Livewire\Volt\Component;

new class extends Component {

    #[Layout('components.layouts.custom')]
    public function mount()
    {
    }


}; ?>

<div >
   
</div>

for a volt class component. When i tried using the attribute on the anon class it's not.

1 like

Please or to participate in this conversation.