symfony/ux-swup
symfony/ux-swup integrates Swup’s AJAX page transitions into Symfony apps, enabling smooth client-side navigation, animated page loads, and preserved JavaScript state with minimal setup. Ideal for adding modern SPA-like transitions to Twig templates.
Architecture fit — this is the headline finding: the package is not a Laravel package. symfony/ux-swup is part of the Symfony UX initiative and is structurally coupled to Symfony's stack: it ships a Symfony bundle, a Flex recipe, a Twig integration path, and a Stimulus controller that instantiates swup. It assumes Twig templates, the Symfony UX bundle registration model, and either AssetMapper or Webpack Encore for asset delivery. Laravel's equivalents (Blade, Vite, Livewire/Alpine) have no overlap with any of those integration points. Adopting it in a Laravel codebase would mean importing a second PHP framework's runtime conventions for one client-side navigation feature — a poor trade.
What is actually portable is the underlying JS library, swup, which is framework-agnostic. The Symfony package is essentially ~100 lines of glue: register the Stimulus controller, expose a Twig helper, register the bundle, wire the swup JS dependency. That glue is trivially reproducible in Blade + Vite.
Integration feasibility. For a Symfony shop: high — Composer install, Flex recipe auto-enables the bundle, one Twig call mounts the controller, done in an afternoon. For a Laravel shop: effectively zero direct reuse; the viable path is npm install swup plus a small Blade partial and a Vite entry point.
Technical risk.
Key questions for the team.
Stack fit. Recommend a split decision:
symfony/ux-swup. Implement the equivalent with swup (npm) + a Blade layout partial + a Vite entry. Budget roughly 1–3 engineer-days including analytics and focus-management hardening — comparable to the effort of fighting a cross-framework integration.Migration path. If the goal is retrofitting an existing server-rendered Laravel app: introduce swup behind a feature flag on a single low-risk section (e.g., marketing pages or a docs area), not the authenticated core. Because swup intercepts link clicks and swaps containers, a partial rollout requires container markup discipline — every page in scope must expose the same container IDs. Audit templates for that consistency before enabling, not after.
Compatibility checklist.
wire:navigate, Inertia) on the same pages — these will fight swup for history and DOM ownership.Sequencing.
<main> on navigation, scroll restoration policy, script re-execution policy.Maintenance. On the Symfony path, the Symfony UX team carries the bundle; our maintenance burden is version bumps aligned to Symfony upgrades. On any other path, there is nothing to maintain from this package — we own our own small swup integration, which is arguably lower total maintenance because it has one fewer dependency layer and no cross-framework version matrix. Either way, budget recurring time for swup JS upgrades, which are the more likely source of breakage.
Support. MIT, no commercial vendor, community GitHub issues. With 33 stars, expect to self-diagnose most problems. Mitigate by keeping the integration thin enough that the team can read all of it in one sitting — another argument for the hand-rolled Laravel approach.
Scaling. The PHP-side impact is negligible; this is a client-side concern. Partial navigation reduces bytes transferred per navigation, which generally improves perceived performance and can reduce bandwidth. Server-side, expect a modestly different request distribution (more partial/HTML-fragment requests, fewer full documents) — confirm your caching and CDN rules treat those consistently.
Failure modes to plan for.
Ramp-up. For a Symfony team already using UX + Stimulus: near zero — hours. For a Laravel team: the package itself offers no transferable knowledge, but swup concepts (containers, hooks, cache) are learnable in a day by a mid-level front-end engineer. The real ramp-up cost is institutional: teaching the team the new navigation lifecycle so future features don't silently break it. Assign a named owner for the client-side navigation layer; unowned, it will decay within two quarters.
Recommendation. Treat symfony/ux-swup as out of scope for a Laravel codebase and as a low-risk convenience for Symfony codebases. Validate demand for SPA-style transitions against the analytics and accessibility costs before committing, and if the answer is yes, prefer the thinnest integration that satisfies the requirement over adding a framework-crossing dependency.
How can I help you explore Laravel packages today?