Mahmoud Al-HabashOpen to new projects
  • WorkWork
  • ServicesServices
  • LabLab
  • WritingWriting
  • ContactContact
Amman--:--عربي
Writing/Livewire

Component Slots in Livewire v4: Blade-Style Flexibility

Use Blade-style slots in Livewire components for composable UIs.

1 February 20261 min readLivewireاقرأ بالعربية

On this page

  1. Default Slots
  2. Named Slots
  3. In Component

Livewire v4 brings Blade-style slot support to components.

Default Slots

blade
<wire:modal>Create Post</wire:modal>

Named Slots

blade
<wire:modal>
    <wire:slot name="header">
        <h1>Create Post</h1>
    </wire:slot>
    <form>...</form>
</wire:modal>

In Component

blade
@if ($header = $slot('header'))
    {{ $header }}
@endif
{{ $slot }}
All articles

Keep reading

  • Authorization in Livewire v4 Components1 February 20261 min read
  • Blaze Pre-Compiler: Massive Performance Gains in Livewire v41 February 20261 min read
  • Building a Bookmark Feature with Livewire v41 February 20261 min read