ethanbarlo/mesh

Render React, Vue, or Svelte components as the frontend of your Livewire components.
480
Install
composer require ethanbarlo/mesh
Latest Version:v0.2.0
PHP:^8.3
License:MIT
Last Updated:Sep 26, 2026
Links: GitHub  ·  Packagist
Maintainer: ethanbarlo

Mesh

A React, Vue, and Svelte bridge for Livewire 4. Render interactive framework components inside Livewire, with props flowing across the boundary.

What it does

Mesh lets you drop a React, Vue, or Svelte component into a Livewire view and treat it as an island. Livewire owns the server state; Mesh hands props across the bridge and mounts the component.

Install

composer require ethanbarlo/mesh

See INSTALL.md for the full host-app setup (Vite alias, app.ts, Livewire start).

Quick example

1. The PHP component

<?php

namespace App\Mesh;

use EthanBarlo\Mesh\Component;

class Counter extends Component
{
    public function props(): array
    {
        return [
            'start' => 0,
        ];
    }
}

2. The React component

A component is a folder whose index.{tsx,jsx} default-exports it.

// resources/js/mesh/Counter/index.tsx
import { useState } from 'react'

export default function Counter({ start }: { start: number }) {
  const [count, setCount] = useState(start)
  return <button onClick={() => setCount(count + 1)}>{count}</button>
}

3. Wire up app.ts

There is no per-component registration and nothing to declare for components. Mesh auto-discovers every component under resources/js/mesh and code-splits each into its own async chunk, loaded on first render. You only register your renderers:

// resources/js/app.ts
import { Livewire, Alpine } from '../../vendor/livewire/livewire/dist/livewire.esm'
import { initMesh } from '@mesh'
import reactRenderer from '@mesh/react'

initMesh(Livewire, {
  renderers: [reactRenderer],
  debug: true,
})

Livewire.start()

4. Render in Blade

<mesh:counter />

Documentation

Full documentation lives at mesh.ebarlow.dev.

Laravel Boost

Mesh ships AI guidelines and a mesh-development agent skill for Laravel Boost. If your app has Boost installed, php artisan boost:install (or boost:update --discover) picks them up automatically, teaching AI coding agents Mesh's conventions — component scaffolding, ID matching, entangle modes, and slots.

Requirements

  • PHP 8.3+, Laravel 11 or 12
  • Livewire 4
  • Node with Vite (host app)

License

MIT

Why an alias instead of npm?

The frontend lives in the Composer package so the PHP and JS ship together and can never drift in version. The @mesh alias points Vite at vendor/ethanbarlo/mesh/resources/js. There is no separate npm install step for the runtime.

Component ids

A component's id is a simple string, derived identically on both sides. The PHP component() method derives it from the class name relative to App\Mesh (App\Mesh\Counter → Counter, App\Mesh\Forms\Input → Forms/Input), and the JS registry derives the same id from the folder path under the fixed resources/js/mesh directory. Because make:mesh StudlyCases both the class segments and the folder names, the two always agree. See components and discovery for details.

Related Packages

jeremykenedy/laravel-toast

Multi-framework toast notifications for Laravel with Tailwind, Bootstrap 5, Boot...

174 1
sooand/turbojetstream

Extension of the Tailwind scaffolding Jetstream for the Laravel framework.

5 0
shopper/starter-kits

Minimum scaffolding starter kit for Shopper e-commerce

754 17
ethanbarlo/livewiremesh

This is my package livewiremesh

1,943 0

Version History

Version Released PHP Laravel License
v0.2.0 ^8.3 ^11.0||^12.0 MIT
v0.1.0 ^8.3 ^11.0||^12.0 MIT