PHPackages                             paznera/nette-inertia-js - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. paznera/nette-inertia-js

ActiveLibrary[Framework](/categories/framework)

paznera/nette-inertia-js
========================

Modern JavaScript framework integration for Nette using Inertia.js

02PHP

Since Nov 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/PaznerA/nette-inertia-js)[ Packagist](https://packagist.org/packages/paznera/nette-inertia-js)[ RSS](/packages/paznera-nette-inertia-js/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

WIP: Nette Inertia.js Extension
===============================

[](#wip-nette-inertiajs-extension)

WARNING: Development moved into monorepo with demo app. Nette extension composer and npm package will be separated into this one after some polishing.

SEE: [Demo app](https://github.com/PaznerA/nette-inertia-react-demo/tree/feat/complex-component/vim-game)

---

[![Build Status](https://github.com/PaznerA/nette-inertia-js/workflows/CI/badge.svg)](https://github.com/PaznerA/nette-inertia-js/actions)[![Downloads this Month](https://camo.githubusercontent.com/2f608cf3111ae842dbe307ed39e84f2196c7244defad5b72d881a00a7efde561/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f50617a6e6572412f6e657474652d696e65727469612d6a732e737667)](https://packagist.org/packages/PaznerA/nette-inertia-js)[![Latest stable](https://camo.githubusercontent.com/056f9fc4f51b41831d9c5056410fc8fa9974389ff710069298a81f327da12d81/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f50617a6e6572412f6e657474652d696e65727469612d6a732e737667)](https://packagist.org/packages/PaznerA/nette-inertia-js)[![Coverage Status](https://camo.githubusercontent.com/136b78c6aee0dddd89661ee79021397af747f15471706ba65e517ed1386f4103/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f50617a6e6572412f6e657474652d696e65727469612d6a732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/PaznerA/nette-inertia-js?branch=master)

Modern JavaScript framework integration for Nette using Inertia.js

Features
--------

[](#features)

- 🚀 Support for Vue.js, React, and Svelte
- 🔄 Server-side rendering (SSR) support
- 🛠 Type-safe PHP 8 implementation
- 📦 Easy integration with Nette DI Container
- 🎨 Asset versioning support
- 🔌 Middleware for handling Inertia requests
- 🎯 Custom Latte macros

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Nette 3.1 or higher
- npm/yarn for frontend dependencies

Installation
------------

[](#installation)

1. Install via Composer(TODO):

```
composer require paznera/nette-inertia-js
```

2. Register extension in your config.neon:

```
extensions:
    inertia: PaznerA\NetteInertia\InertiaExtension

inertia:
    framework: vue  # options: vue, react, svelte
    ssr: false
    rootView: App/Views/Root
    version: null   # optional - for asset versioning
```

3. Install frontend dependencies based on your chosen framework:

For Vue.js:

```
npm install @inertiajs/vue3
# or
yarn add @inertiajs/vue3
```

For React:

```
npm install @inertiajs/react
# or
yarn add @inertiajs/react
```

For Svelte:

```
npm install @inertiajs/svelte
# or
yarn add @inertiajs/svelte
```

Usage
-----

[](#usage)

### Basic Setup

[](#basic-setup)

1. Create a base presenter:

```
abstract class BasePresenter extends PaznerA\NetteInertia\InertiaPresenter
{
    // Your base presenter logic
}
```

2. Create your root template (App/Views/Root.latte):

```

    My Inertia App
    {block head}{/block}

    {inertia}
    {block scripts}{/block}

```

3. Set up your frontend entry point (e.g., assets/app.js):

```
// Vue.js example
import { createApp, h } from 'vue'
import { createInertiaApp } from '@inertiajs/vue3'

createInertiaApp({
    resolve: name => {
        const pages = import.meta.glob('./Pages/**/*.vue', { eager: true })
        return pages[`./Pages/${name}.vue`]
    },
    setup({ el, App, props, plugin }) {
        createApp({ render: () => h(App, props) })
            .use(plugin)
            .mount(el)
    },
})
```

### Using in Presenters

[](#using-in-presenters)

```
class HomepagePresenter extends BasePresenter
{
    public function renderDefault(): void
    {
        $this->renderInertia('Homepage/Index', [
            'welcome' => 'Hello from Inertia.js!',
            'timestamp' => new DateTime(),
        ]);
    }
}
```

### Creating Components

[](#creating-components)

Vue.js example (Pages/Homepage/Index.vue):

```

        {{ $page.props.welcome }}
        Current time: {{ $page.props.timestamp }}

defineProps({
    welcome: String,
    timestamp: String,
})

```

Advanced Configuration
----------------------

[](#advanced-configuration)

### Server-Side Rendering (SSR)

[](#server-side-rendering-ssr)

Enable SSR in your configuration:

```
inertia:
    ssr: true
    # ... other options
```

### Asset Versioning

[](#asset-versioning)

Implement version checking for automatic reload on asset changes:

```
class AssetsVersionProvider
{
    public function getVersion(): string
    {
        return md5_file(WWW_DIR . '/dist/manifest.json');
    }
}
```

```
inertia:
    version: @AssetsVersionProvider::getVersion()
```

### Shared Data

[](#shared-data)

Share data across all components:

```
class BasePresenter extends InertiaPresenter
{
    protected function startup(): void
    {
        parent::startup();

        $this->inertia->share('user', $this->getUser()->isLoggedIn()
            ? $this->getUser()->getIdentity()->toArray()
            : null
        );
    }
}
```

Contributing
------------

[](#contributing)

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Create a Pull Request

Testing
-------

[](#testing)

Run tests:

```
composer test
```

Run static analysis:

```
composer phpstan
```

Run coding standards check:

```
composer cs-check
```

License
-------

[](#license)

TODO: most likely MIT License

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ea15ae1a7b85d4272b5cb15afc5c37dcb1920c66f34beecb84c269aab9bbeba?d=identicon)[PaznerA](/maintainers/PaznerA)

---

Top Contributors

[![PaznerA](https://avatars.githubusercontent.com/u/7112679?v=4)](https://github.com/PaznerA "PaznerA (6 commits)")

### Embed Badge

![Health badge](/badges/paznera-nette-inertia-js/health.svg)

```
[![Health](https://phpackages.com/badges/paznera-nette-inertia-js/health.svg)](https://phpackages.com/packages/paznera-nette-inertia-js)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M257](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M593](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
