Addon by Jonas Siewertsen

Livewire Main Screenshot

A Laravel Livewire integration for Statamics Antlers template engine.

Wanna learn Statamic?

Visit my newest project Many tutorials are free.


A third-party Laravel Livewire integration for Statamic.

It's as easy as it get's to get stared with Livewire if using Statamic 3.


Pull in the Livewire package with composer

composer require jonassiewertsen/statamic-livewire


Make sure to read the Livewire upgarde guide, in case you're updating to Statamic Livewire 3, as there are breaking changes:

General documentation

Livewire Docs

Livewire scripts and styles

Livewire injects its styles and scripts automatically into the page. However, this does not work if caching is enabled (half/full). In that case, you want to include them manually, by using the respective tags {{ livewire:styles }} and{{ livewire:scripts }}.

In case you need to include some custom Alpine plugins, you can bundle the assets yourself and disable the automatic injection by using the {{ livewire:scriptConfig }} tag. Do not forget to include the {{ livewire:styles }} tag as well.

        <!-- If using Antlers -->
        {{ livewire:styles }}

        <!-- If using Blade -->

        <!-- If using Antlers -->
        {{ livewire:scripts }} / {{ livewire:scriptConfig }}

        <!-- Blade -->
        @livewireScripts / @livewireScriptConfig

Include components

You can create Livewire components as described in the general documentation. To include your Livewire component:

    <!-- If using Antlers -->
    {{ livewire:your-component-name }}

    <!-- If using Blade -->
    <livewire:your-component-name />

Blade or Antlers? Both!

If creating a Livewire component, you need to render a template file

namespace App\Http\Livewire;

use Livewire\Component;

class Counter extends Component
    public function render()
        return view('livewire.counter');

More Information: (

Normally your template file would be a blade file, named counter.blade.php. Great, but what about Antlers? Rename your template to counter.antlers.html, use Antlers syntax and do whatever you like. No need to change anything inside your component Controller. How cool is that?

Passing Initial Parameters

You can pass data into a component by passing additional parameters

<!-- If using Antlers -->
{{ livewire:your-component-name :contact="contact" }}

<!-- If using Blade -->
<livewire:your-component-name :contact="$contact">

To intercept with those parameters, mount them and store the data as public properties.

use Livewire\Component;

class ShowContact extends Component
    public $name;
    public $email;

    public function mount($contact)
        $this->name = $contact->name;
        $this->email = $contact->email;


The Official Livewire documentation

Paginating Data

You can paginate results by using the WithPagination trait.


To use pagination with Blade, please use the Livewire\WithPagination namespace for your trait as described in the Livewire docs.


Pagination with Antlers does work similar. Make sure to use the Jonassiewertsen\Livewire\WithPagination namespace for your trait if working with Antlers.

In your Livewire component view:

{{ entries }}
{{ /entries }}

{{ links }}
use Jonassiewertsen\Livewire\WithPagination;

class ShowArticles extends Component
    use WithPagination;

    protected function entries()
        $entries = Entry::query()
            ->where('collection', 'articles')

        return $this->withPagination('entries', $entries);

    public function render()
        return view('', $this->entries());

EXPERIMENTAL: Statamic Support

As a little experiment, support for an Entry or EntryCollection has been added, so you can make an entry or a entry collection simply a public property and it just works.

Supported types: - Statamic\Entries\EntryCollection; - Statamic\Entries\Entry;

namespace App\Livewire;

use Livewire\Component;
use Statamic\Entries\EntryCollection;
use Statamic\Entries\Entry;

class Foo extends Component
    public EntryCollection $entries;
    public Entry $entry;

    // normal livewire stuff

To make it work, you need to enable that feature first.

  1. php artisan vendor:publish
  2. Select statamic-livewire in the list
  3. Enable synthesizers

Entangle: Sharing State Between Livewire And Alpine

In case you want to share state between Livewire and Alpine, there is a Blade directive called @entangle. To be usable with Antlers, we do provide a dedicated tag:

<!-- With Antlers -->
<div x-data="{ open: {{ livewire:entangle property='showDropdown' modifier='live' }} }">

<!-- With Blade -->
<div x-data="{ open: @entangle('showDropdown').live }">

It's worth mentioning that, since Livewire v3 now builds on top of Alpine, the @entangle directive is not documented anymore. Instead, it's possible to entangle the data via the $wire object.

<div x-data="{ open: $wire.entangle('showDropdown', true) }">        

This: Accessing the Livewire component

You can access and perform actions on the Livewire component like this:

It's worth mentioning that, since Livewire v3 now builds on top of Alpine, the @this directive is not used widely anymore. Instead, it's possible to access and manipulate the state directly via JavaScript / the $wire object.

Lazy Components

Livewire allows you to lazy load components that would otherwise slow down the initial page load. For this you can simply pass lazy="true" as argument to your component tag.

<!-- With Antlers -->
{{ livewire:your-component-name :contact="contact" lazy="true" }}

Other Statamic Livewire Packages

If using Livewire, those packages might be interesting for you as well: - Statamic live search - Statamic Livewire Forms - Antlers Components

Did I miss a link? Let me know!


Thanks to: - Caleb and the community for building Livewire - Austenc for the Statamic marketplace preview image


  • PHP 8.1
  • Laravel 10
  • Statamic 4


I love to share with the community. Nevertheless, it does take a lot of work, time and effort.

Sponsor me on GitHub to support my work and the support for this addon.


This plugin is published under the MIT license. Feel free to use it and remember to spread love.