Skip to content

Integration with Symfony UX Turbo

Symfony UX Turbo is a Symfony bundle integrating the Hotwire Turbo library in Symfony applications. It is part of the Symfony UX initiative.

Symfony UX Turbo allows having the same user experience as with Single Page Apps but without having to write a single line of JavaScript!

...read more about the bundle on the official documentation.

This bundle provides integration that works out-of-the-box.

The magic part

To begin with, make sure your application uses the Symfony UX Turbo.

The next step is... voilà! ✨ You don't have to configure anything extra, your data tables automatically work asynchronously!

The magic comes from the @KreyuDataTable/themes/base.html.twig template, which wraps the whole table in the <turbo-frame> tag:

    <turbo-frame id="kreyu_data_table_{{ name }}">

    </turbo-frame>

Note

This also works out-of-the-box when using other built-in templates, because they all extend the base one. If you're making a data table theme from scratch, make sure the table is wrapped in the Turbo frame, as shown above.

For more information, see official documentation about the Turbo frames.