Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Ux Svelte Laravel Package

symfony/ux-svelte

Official Symfony UX integration for Svelte. Render Svelte components from Twig, pass props, and add interactive UI to Symfony apps without building a separate SPA. Includes Stimulus bridge, asset setup, and conventions for modern Svelte frontends.

View on GitHub
Deep Wiki
Context7

Integration of Svelte in Symfony

Frequently asked questions about Ux Svelte
Can I use symfony/ux-svelte in a Laravel application?
Not directly. symfony/ux-svelte is a Symfony UX integration with no service provider, published config, facade, or Blade directive, and its PHP layer is wired into the Symfony container and Twig extension system. In a Laravel app you would end up bypassing all of the package's PHP code and using only its JavaScript conventions, at which point you are not really using the package. Reproducing the mount pattern natively with Blade, @vite, and mount() is lower risk than porting it.
How do I install symfony/ux-svelte?
Run composer require symfony/ux-svelte inside a Symfony application, then apply the Symfony UX Flex recipe, which registers the Twig extension and Stimulus controller. You also need an asset pipeline such as AssetMapper or Webpack Encore plus the Svelte compiler in your front-end build. The package is a read-only subtree split of the symfony/ux monorepo, so issues and pull requests belong upstream.
Which Laravel and PHP versions does symfony/ux-svelte support?
None, because it is not a Laravel package and declares no Laravel constraints. It targets Symfony 6.x and 7.x with the PHP versions required by the upstream symfony/ux monorepo. If you want Svelte in a Laravel application, use the first-party Vite setup instead of this Composer package.
Does symfony/ux-svelte work with Laravel Vite?
No. The package assumes Symfony's AssetMapper or Webpack Encore pipeline and ships Twig helpers and Stimulus controllers that do not exist in Laravel. Laravel's @vite directive and Vite plugin setup are a completely different integration surface. You can borrow the ideas but not the wiring.
How does symfony/ux-svelte pass props from PHP to Svelte components?
A PHP service serializes server-side props to JSON, and Twig renders a mount div that carries that data as an attribute. A Stimulus controller then hydrates the registered Svelte component against that DOM node. The boundary is untyped, so renaming a prop on one side produces a silent undefined at runtime instead of a build failure.
Does symfony/ux-svelte support server-side rendering?
There is no first-class SSR. Rendering Svelte on the server requires a separate Node rendering path outside the package. If SEO or fast first paint matters for any consumer-facing surface, budget that work upfront rather than assuming the bridge covers it.
Why does symfony/ux-svelte have only around 30 GitHub stars?
The star count reflects the read-only subtree split, not the upstream project. The real code lives in symfony/ux, which is maintained by the Symfony core team with genuine production adoption. Use the monorepo's release cadence as your maintenance signal, not this repository's stars.
Does symfony/ux-svelte support Svelte 5?
Check the current release notes before committing, because Svelte 5 introduced runes and changed component authoring and reactivity semantics. Bridge packages typically lag framework majors. The package targets a specific Svelte major per release, so pin the version accordingly.
What is the best way to add Svelte to a Laravel app without a full SPA?
Use Svelte directly through Vite: install svelte and @sveltejs/vite-plugin-svelte, expose components via @vite in a Blade view, and mount them on elements that carry a data-props JSON attribute. That is the same island pattern symfony/ux-svelte implements, but in roughly 100 to 200 lines you own and understand. Inertia or Livewire are the heavier options when you actually want a full SPA or server-driven reactivity.
What are the alternatives to symfony/ux-svelte for Laravel developers?
For Svelte specifically, the native Vite plus mount() island pattern is the practical choice. For broader front-end integration, Laravel ships first-party Vue and React starters plus an Inertia adapter, and Livewire covers server-driven interactivity without a JavaScript framework. symfony/ux-svelte is worth reading as a reference implementation, not adopting.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager