Beta: Livewire Bridge targets Craft CMS 6, which is still in beta. Expect breaking changes until Craft 6 is stable. Please test it before using it in production and report issues on GitHub.
Livewire Bridge lets you write Craft templates as Livewire 4 single-file components, so you can build reactive pages without writing JavaScript.
When Craft routes a request to a Blade template (an entry URI, a section template or a custom route) and that template is a Livewire component, the plugin mounts it as a full-page Livewire component instead of rendering a plain view.
Features
- Zero config: point a section's template at a
.blade.phpfile written asnew class extends Component { … }and it just works. - Craft variables become component state:
$entry,$categoryand other template variables are passed to matching public properties ormount()arguments. - Elements as Livewire properties: entries, assets, users and other elements are stored as lightweight references (class, ID, site) and re-fetched on every request, just like Eloquent models.
- Layouts: supports
#[Layout],#[Title],$view->layout()and thelivewire.component_layoutconfig. - Everything Livewire:
wire:click,wire:model, validation,wire:navigate, loading states and more. - Plays nicely with Craft: regular Blade and Twig templates keep rendering exactly as before.
Example
Set your section's template to news/_entry.blade.php:
<?php
use CraftCms\Cms\Entry\Elements\Entry;
use Livewire\Attributes\Layout;
use Livewire\Component;
new #[Layout('layouts::app')] class extends Component {
public Entry $entry; // injected by Craft
public int $likes = 0;
public function like(): void
}
};
?>
<article>
<h1>{{ $entry->title }}</h1>
<button wire:click="like">Like ({{ $likes }})</button>
</article>
Visit the entry's URL. The button updates the count without reloading the page.
Requirements
- Craft CMS 6.0.0-beta.1 or later
- Livewire 4.0 or later
- PHP 8.4 or later
Known limitations
- Collections of elements (such as an
ElementCollectionproperty) aren't synthesized yet. Store IDs in a#[Locked]property instead. - During Live Preview, unsaved changes are lost after the first Livewire request, because the element is re-fetched from the database.
- Only single-file components are supported as Craft-routed templates.
Documentation
Full documentation and examples are available on GitHub.
To install this plugin, copy the command above to your terminal.
This plugin doesn't have any reviews.


