Home API Tools Posts Hire Me About
Sign In Create Account
Livewire

Component Attributes in Livewire v4: Forwarding HTML Attributes

February 01, 2026 1 min read 58 views

Livewire v4 adds support for forwarding HTML attributes to components.

Usage


    Something went wrong!

Component

@php
new class extends Livewire\Component {
    #[Prop]
    public string $type = 'info';
}
@endphp

merge(['class' => 'alert alert-'.$type]) }}> {{ $slot }}
Share this post:

Related Posts

Comments (0)

Please log in to leave a comment. Log in

No comments yet. Be the first to comment!