Hotwire Native Integration

Go Native with your Symfony app

Wrap your Symfony web application in a native mobile shell with Hotwire Native. Detect native requests, conditionally render content, and generate JSON configurations for your mobile clients.

composer require symfony/ux-native

What Native gives you

  • Your app, wrapped

    iOS and Android shells around your Symfony app.

  • Request detection

    Know when a native client asks for a page.

  • Conditional rendering

    Serve a different template to native clients.

  • Path configuration

    Generate the JSON your mobile clients consume.

  • Native navigation

    Modals, tabs and back stacks, driven from PHP.

Without UX Native

A Symfony + Bootstrap todo-list app displayed inside a mobile browser, with the browser navigation bar and the web navbar visible.

Browser navigation bar, web navbar — it feels like a website.

With UX Native

The same Symfony + Bootstrap todo-list app but with Hotwire Native: native title bar, no browser chrome, clean native experience.

Native title bar, no browser chrome — it feels like an app.

What the bundle hands your app

The server drives the shell.

Your Symfony application decides what the mobile client sees and how it navigates. The shell only follows.

Native requests, detected

A listener flags requests coming from the shell, and Twig branches on it.

{% if ux_is_native() %}
    {# the native shell draws its own bar #}
{% else %}
    {{ include('_navbar.html.twig') }}
{% endif %}

Navigation written in PHP

Describe which paths open as a modal or push a new screen. No JSON written by hand.

#[AsNativeConfiguration('/config/ios.json')]
public function ios(): Configuration
{
    return new Configuration(rules: [
        new Rule(
            patterns: ['/new$'],
            properties: ['presentation' => 'modal'],
        ),
    ]);
}

Built on demand

One command renders every configuration file your clients download at launch.

php bin/console ux:native:build-configs

Install Native.

$ composer require symfony/ux-native

More from Symfony UX.

Native is one package among many. They share the same Stimulus foundation and install the same way.

Image for the Live Components UX package

Live Components

Build dynamic interfaces with zero JavaScript

Image for the Turbo UX package

Turbo

Integration with Turbo for single-page-app and real-time experience

Image for the Stimulus UX package

Stimulus

Integration with Stimulus for HTML-powered controllers

Browse every package

Keep Native at hand.

Documentation, the people behind it, and where to ask when something does not behave.